#development
1 messages · Page 2008 of 1
and yeah its too saturated over there
you're much better off making things that you like than working for fiverr fees
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
lmao
I probably should make a business card like portfolio site. Certainly couldnt hurt to have
im planning to make one for myself, but i have so many unfinished projects to do lol
portfolios are some of the most boring things ever to build
I tried 3 times and gave up
hate talking about myself
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
oh.. I mean I could see that but I specifically mean tooting my own horn type beat
otherwise I enjoy both
when you see yourself everyday it gets boring over time
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
ye
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 😄
go make a parser
for what? i have
i often find myself spending days thinking about buffers and low level data structures
lmao
what parser have you written
even if im not actually working on them
https://www.npmjs.com/package/dekita-md-embed
parse md files into discord embeds 😂
https://www.json.org/json-en.html probably the most basic and familiar one. Go use this to learn a new language and it's even more fun
or make a binary serializer like me
perhaps not quite what you meant, but thats why you gotta specify 😄
xD
i've also written a similar markdown style parsing system for my game engine
that parses md like files into in game scripts
have you tried working with binary files at all?
make a bytecode compiler
that's a really fun one
With an interpreter
nah, the 1's are ok, but 0's scare me 😨
a java -> python parser 
lmao
while you're at it, make it bi-directional
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
i've done a little bit of work with byte data (arduino rgb + bluetooth + android app project) ~ that was fun 🙂
like jpa?
Never heard of it
it's a java ORM that also has a SQL compiler/interpreter (jpql)
and makes database transactions very seamless
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 😩
What are these two files are called?
yarn.lock
package-lock.json
yarn.lock and package-lock.json
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
You're a good guy. 😏
discord keeps messing up with me
now they are sending interactions and buttons in voice channels
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
if (!message.channel.id === 955864875928780900) return this just doesn't work lol
the lib tries to add the messages to channel.messages but voice channels dont have .messages lel
Yeah cause id is a string
oh
Not a number

And remove that logical NOT operator (!) from there as well as it coerces the value into a boolean, use the string inequality operator (!==)
bun somethings being very weird
How does that work given there are messages 
of course 
ok ty 
it doesnt
lel
discord.js never though about the possibility of voice channels being able to have messages
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
It opens like a thread
never used that feature either lol
seems a bit strange for them to add that feature imo
unless they plan to eventually just have 'channels' that are multi purpose
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
yea i guess that is fair
is it possible to fully remove buttons from a message after clicking
Can I go back in git commit history, and ammend some changes to specific commit?
edit the message with an empty components array
Yes, use git rebase interactively
alrighty
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
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?
yes, setInterval is non-blocking
I’m not so sure about this sort of thing but I think you could also use a worker if you’d like
very quick question, ive never really figured out what this does
Bot.application?.commands
what does the ?
do
I don't care that much about it. I just want it to ping itself every minute so that my repl doesn't die
it checks if Bot.application exists in that case
Thank you 
i think itll just do whatever exists
const value = commands?.property?.run()``` if either commands or property is undefined, then the overall value will be undefined
like if theres no Bot.application it will just act as Bot
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'
})```
no application.commands permission probably
^ like that
is that an intent?
no its a thing on the invite
you need both bot scope, and application.commands scope
How do i get the application.commands scope
oh
oof does that mean I gotta reinvite the bot on all the servers?
or is this global
yerp ~ congrats 😄
yes or you can just handle the error and not give the guilds without the permission slash commands
oooooof
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
dang this has really changed
its sad that you don't get the permission from just having "ADMINISTRATOR"
¯_(ツ)_/¯
tbh yea, the scope issue is the biggest one i've found witch upgrading
should definitely be a permission instead
there might be some way to avoid the whole kick/reinvite thing, but idk if there is
cause reinvite is annoying and can mess up some bots configs
i've literally just spent like 2 hours fighting with checkbox logic 😐
any other scopes that I should add just to future proof
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 😛
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
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)
It is in the guild but listed as integration or however it’s been called
With the additional bot scope it’s still listed as member (bot)
i wonder how long till we are all integration devs 😄
is there a speed penalty for using a variable when doing require()?
no. require calls are also cache'd, so the second call will be faster than the first (for same module being required)
Eww use slash commands can be unselected
thanks
The bot can’t use slash commands
What are you actually doing?
and where does it say that the perms are invalid?
lol feel free to dm me a link to test 🙂
I can't see any issue
I did dekita
Bots can't use video, too I guess
oh yes
why would there be a selectable for it though?
that fixed it
for the future
Because it's a permission bitflag calculator
when it maybe is supported
arent there bots that stream video like they do music?
yea thats fair lol
nope
thatd be epic
but probably not
i mean, if the bot was able to stream...
there was a voice phone at one point
wouldnt be too hard to pull that stream from somewhere else
but too much internet
great... a new way of advertisment
lol

and they didn't moderate it well
so it didn't go well when you joined
it was like a cod lobby
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
yeah
Does anyone have a good tut to install @discordjs/opus on windows and on linux
npm install @discordjs/opus :troll:
npm install -g windows-build-tools for windows
then npm install @discordjs/opus
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?
Sits stuck at a point
packages not installed
@spark flint
takes time to download
its not 30 min
i did that
go to its folder then
where the nodejs app is set
then
stderr.log
scroll to bottom of there, thats the error
ooooh thanks
it says this Error: Cannot find module 'node:events'
how could that occur
oh dang it guess that's not gonna work https://cdn.luckiecrab.nl/i/chrome_XndpwanTIh.png
contacting my hosting if they can do anything
oh alright, didnt it need 16
for what?
alright
node 10 is awfully outdated
code issue now
you'll need to ask for updated node to your host
oh yeah... its gotta be v16 cause d.js v13
yeah
not only that, but optional chaining
host is on it
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
})
})```
eh maybe not
given you're creating a command N number of times instead of all at once
which currently issues more http requests
I have a file with that called 'update-commands' that i run whenever i have to update commands
oh god rest
i also have an update-commands command for my bot 😄
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?
@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?
Do you actually have an active gateway connection aka. bot scope?
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 😄
why would you want to unnessicarily run code?
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
ahh ok, then yea thats totally fine for development imo
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)
been like that since the redesign
if you only need a screenshot, you can do webContents.capturePage()
takes me 10 seconds to search for suggestion bots and I'm still getting irrelevant bots
I need the actual text content of the page preferably
Hey dekita, for global commands should I loop thru all commands and see if they exist, and if not then add them?
for global commands, I send an array of all commands, idk if you can globally define individual commands
I didn't know you can send an array
i use the rest thing as well remember, idk if its different when using discord.js internals
array with one element 
if i define an array of 3 commands globally, and then set them to be an array of 1 command, it undefines the other 2 im sure
big problems require big compromises
but yes you can create individual commands with a different endpoint
no problem, no comprimise ~ just set all commands at once 😄
and it won't overwrite the other ones
let big_problem = require('big-comprimses');```
well big problems may be changed
causing more problems 😄

random question: how many times on average do you rewrite code before publishing/pushing it?
probably about 3-4
way more organized that way
after 2 I add comments
and missing semi-colons
eww comments 😛
if you comment everything then the documentation takes just as long as the code in my experience 😦
I try to write most of my code so that I can understand the logic easily at a glance, i'll comment complex things
//this area of the code processes commands, checks arguments then executes the file
Yeah that makes sense
^ the one 'fully commented' function in 600 lines 😄
the font ;-;
if you mean in objekt, thats cause it is 😄
legendary
lmao

dont lie, you know you add 'fake_' before every function you write 😄
nah ~ inconsistency is key!
Shhh nobody needs to know that
My gosh, building my frontend for weeks now and yet a lot of backend stuff isn’t even done 
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 🤔
It’s actually getting damn nice for what I’m capable of
pics or lies! 😘
Hmm doesn’t make much sense yet tbh
There’s just static but very specific content available
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
Nah not for my bot
But For the specific service my bot also offers
And yeah it’s also on he site, stats, invite, command examples etc
what is it your bot does?
oooohhh steam stuff, nice
For gaming communities
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
dark should be default
❤️
i preffer light for certain sites, also dunno why
seems easier to make a nice dark theme compared to a light one too imo
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
Hmm I don’t work with color pallets
Dunno why you would ever need purple of two stages of blue 
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
Hmm well yeah takes longer for me to do things as I literally do anything my own
might be 60
yea, those arent the default bootstrap styles, that my custom style that i've slowly written over the past decade 😄
Alright gtg leaving highway 
Hmm too bright
theres too many flaws that could be picked out with the default colors imo
but they obviously chose them for accessibility reasons or whatever
looks a little like the https://github.com/fosscord/fosscord-ui theme
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
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
And white for dark mode
you should not have to require anything within your running browser window html page's js
you should preload anything you require
then set the webPreferences for your browser window
you can enable node integration, its not recommended
Yeah I've got a preload script, just didn't know that you needed to preload stuff like that
if you want your preload script to set window.properties, you need to also set contextIsolation to false
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?
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;
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
and then your html file loads some script.js file with this: ```js
document.addEventListener('DOMContentLoaded', async event => {
console.log(AwesomeSauce.working)
});
but res should be a function with editreply
ah okay I see now
you can also ~ in your preload script ~ and your main app script - define handlers for communicating between those two 🙂
agh, now my event isn't being prevented from loading the page, haha
😄
got it now
you need to fetchReply: true if you want the reply object 🙂
like where content is?
interaction.reply({
content: `Loading...`,
fetchReply: true
}).then((res) => {
res.editReply({
content:`${Date.now() - before}ms`
})
})```
says res.editReply isn't a function
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)
the response is likely the message object for the reply message. arent you trying to edit the same interaction, not the response?
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
Im trying to just get the milliseconds it takes, just like the regular message.channel.send().then(.edit...)
how do you mean?
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;
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?
<form onsubmit="event.preventDefault(); window.preload.handleForm(this)">
<label for="name">Name:</label>
<input type="text" class="form-control" id="name">
</form>
yeah
like the ping to discord and back
hmm
I've never really done html stuff like this before because I never understood the interaction between html files and nodejs quite honestly
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?
yup
this is everything that's in my preload file
logs as undefined
if you fetch the deferReply, you can calculate the latency for oyur ping command, thats what i done here: #development message
is contextIsolation: false for your electron BrowserWindow instance?
okay
webPreferences: {
contextIsolation: false,
// enableRemoteModule: true,
// nodeIntegration: false,
preload: path.join(__dirname, 'preload.js')
}```
whoops, I had changed it earlier and forgot to change it back
works now 🙂
❤️
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
the form works as intended, tbh I was just using it to test function calls as I wish
awesome! 🙂
and nothing against definiton of the calls in the html
I just like js more than html 😄
you ever used ejs templating? electron supports that too 🙂
Yeah I've used ejs a little bit
can really help when building large apps with lotsa pages
Didn't think I'd do electron and ejs at the same time though because I'm still pretty new to both lol
I've got a new error to work on now, but thankfully it's js related and hopefully not complex lol
no need really for a single page app 😄
^ ejs from my game engine editor
so freaking messy lmao
jeez
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
now I'm going to struggle to figure out what's wrong with a package that hasn't been updated in 3 years
parses a pdf
yeah I'll give that a try since pdf-parse is giving me issues not related to my code presumably
agh, same error
😦
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
no experience with that issue myself
but is this any help: https://stackoverflow.com/a/26291032
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?
[link name](https://google.com "hover text")
Uh what
ik
It supports tooltips?
yea 🙂
did you look at the link?
hmm I wasn’t aware
you arent fetching the returned message
so are you sure that it actually has the url property?
yep
like, if you console.log(urls) before your message embed gets created, is it the correct url?
perhaps then its the *'s around your link
your error - if its the one at the top of the file you linked, is saying that the author icon url isnt valid
no worries 🙂
why- js .author.icon_url i didn't read this properly
i got attached by this js ('http', 'https') thing
lmao
lol, seems like a fair oversight 😄
which one looks better?
holy shit letters and numbers vertically, hacker
ive been treating it like a wordsearch
ah ok
5 points!
I've changed the color now, tho it's more about the rest
find gay in that
https://sourceb.in/6Lfjxwaytl after trying to implement cooldown on database, the command and aliases not working 
almost 😔
why it looks like a matrix
lmao
Quicky, we need someone to trace a line on the blank spaces
Tim might be hiding a secret image there
it is an amogus image

Ohno
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;
}
}
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
nah I knew constructor override I didn't know you could invoke a ctor with this()
unless that's what you meant
C# is Java 2
I love C# I just never really got into it fully
I'm focusing on c++ java and js/ts
I mean, groovy has no refactor need, any java code is 100% compatible out of the oven
I see
That's why I call it a dlc
It feels like a cross between java, js and ruby
there's some annoying things but overall pretty good lang
I'm starting to learn C by building a bytecode compiler
because http://www.craftinginterpreters.com/contents.html is a fucking amazing resource
I remember that 
well earlier I was doing an interpreter in java but now it's time for a bytecode vm
Insane task
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 
Try making a global language bootstrapper
Like allow linking any lang with any lang
Kinda like what jvm allows, but bi-directional
like a transpiler, or do you mean make it compile to compatible bytecode?
Hello
hi
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
https://docs.oracle.com/javase/specs/jvms/se7/html/ probably quite a large task
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
I KNEW IT
the prophecy is true!
He had to be behind it
it's an incredibly large subject, I love it
gonna study that a lot this summer when I've got more time
You're crazy
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
Call it Hava
lmao perfection
it will hava-ll the features java is missing
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?
Grey area maybe?
still specified in their tos though
Idk how to answer, but nsfw channels do have a "I confirm I'm 18yo" screen
Oh yeah thats true
So discord is no longer liable for potential minor issues once they click
and it doesn't let you in if your under 18
okok
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
I wasn't going too but it was an interesting question to ask with the new api
if your account's birth date is below 18 years ago I'm pretty sure you're blocked entirely from it
yeah
Made a stupid little swing app in computer science today and my teacher was impressed somehow 
They don't really expect students to research on their own
Now u got that teacher's favor
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)
It's not cheating if u carved it yourself
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
I hate when people call cheating stuff they could've done themselves but didn't
Suffered from that a lot on uni
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
Like damn, if I can make QoL tools with programming then I'll fckin do it whenever I can
qol tools are where the money is
QoL tools make up everything now
the hava good ending
What good is an IDE without good tools to go with it
I once made an auto Spotify skipper
Whenever the window title changed to "Advertisement" it'd trigger multimedia next key
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
hm
my host sent this, will that work correctly? https://support.cpanel.net/hc/en-us/articles/360051876714-How-to-install-NodeJS
Do you host cPanel yourself or do you just pay for a hosting plan
What with?
should i use digitalocean or linode
pay for hosting
well sort of
yeah pay for hosting
but i have SSH access
Then only the host can install node16
DigitalOcean
It has to be enabled via WHM after install so no
The question of whether you should use x or y vps provider can be answered by creating your own server PC.
📈
Can any one help me to join bot to voice channel
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
well you can get it via the rest API
pretty sure the user endpoint has the createdAt of the user
Aye and host it at home with your quick 5Mbit/s upload 
or my quick 512Kbit/s upload
how to add a slash command to a context menu?
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
ooohh, so we can define slash command like objects, send them to the api with a different command type id?
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
👋
wave
and smile
hi sayu
network isue
Im using my data
Im having an issue almost a week
But playing game is smooth as pudding
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
Yes
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.
javascript? "somestring".endsWith("string");
or you could use regexp: /(.*)string/i.test("somestring")
/\/c\d+$/i
/ -> 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
How can you push an object to an array in a document in MongoDB?
[].push(new model())
Sorry? How is that done?
object = findById(asdjnasjkd)
object.property.push({asjndajksd})
Now, via the MongoDB Compass, I use the following to set a new property in all the documents.
db.<document>.updateMany({}, { $set: { abcd: 'efgh' }})
Now, correction to my question, how can I push ....... in all the documents in MongoDB?
does anyone know why this doesnt work? https://sourceb.in/OfhhBnNkuc
it's not responding at all
any error?
yeah, no error.
if you console.log before your db code, does it output?
its likely that property does not exist on your returned data object
the api is just dum
what api is that?
is that anti-fish
good job :)
also
yeah
quick! option b!
check the trust rating
thats what i do now
do streamcOmmunIty .com
if the input data has less length than target then we still have leftovers
do dlscord (dot) gg
which is what happened
that always works
sec
if (response.data.match && Number(response.data.matches[0].trust_rating) >= 0.95) { }
thats what i do
your options probably arent set correctly
what
so its just a bad domain fdilter
there is no option
nah its a really good api lol
you just need to check trust rating
where can i put this into my code
you can test the urls directly on their website: https://anti-fish.bitflow.dev/, they dont have gibhub.com
hmm
anywho
where you check for a match
they dont have that one either
OHHHHHHH
wdym
it will only proceed if it matches and the trust rating is above 0.95
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
}```
aw axios
sorry, i was thinking of the 'createWriteStream' function, which allows you to specifiy if it should overwrite the file, or append, etc
i'm not handling a stream tho
im dumb
thanks anyway
but im glad my code aint like that
what kind of bs database do they have?
theyre only added if its a known scam link
and i believe they check new domains too
they won't add every variation of steamcommunity ever
I believe that's the most used scam technique right after discord nitros
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
most of these databases need people to update them
and not only admins, the community needs to help
Imma stick with Google's safebrowsing
i report links all the time
databases like these are worthless if people dont keep updating them
their api uses this database: https://github.com/mitchellkrogza/Phishing.Database
and another
which is publicly updated by github users
theyre only 0.5 from there
so add your reported urls there
if its an actual known scam link the trust rating is 1
nvm im dumb
i kjeep forgetting i enabled the permission checking

@spark flint how would i log the json data into an embed?
literally data
dont work
as that seems to be returning the json
JSON.stringify(data)
oh
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
data.matches
rty
What if it's autonomous?
how?
do something like .addField("Matches", JSON.stringify(data.matches))
By checking newly registered domains, and a periodic check. 🎉
not always accurate
send in code block
Been pretty accurate up until now.
try adding a field for each match
yeah i might
JSON.stringify(data.matches, null, "\t")
IDK what gosusluigi means but half of their domains somehow contain this word
lmao
data.matches.forEach(function(match) {
embed.addField("Match",`Domain: ${match.domain}\nType: ${match.type}\nTrust rating: ${match.trust_rating}`)
})```
maybe that
or something
looks like a russian authorization portal
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
any update on the node ipc situation? 😄
nope
well
pretty much useless now
ruble waaaayyyyy to down
no problemo
i wonder if my ipc lib got more downloads because of the node-ipc situation
nah not really
sadly a lot of people are likely totally unaware of the issues
how does your ping command look?

i would change the word 'powered' to 'protected' in your embed footer
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?
use open office instead? 😛
cant u use the web app versions?
just stuck at this 💀
i also want to use onenote but the browser version does not support my stylus
did you restart the pc?
yeah
how long did you wait?
very long
every time i restart the installer its either at 0% or 3%
forever
no cpu or network usage in task manager either
must be hitting inso some issue and failing to report
running installer as admin?
it asks for admin automatically but i tried explicitly running it as admin too
i'll try compatibility
what version is this?
is it official or warez?
official (what is warez)
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/.
lmao
never heard that term before
i've been using 'privateering' lately cause of linus tech tips (utuber) 😄
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.
oh, cheerrs. btw pls ping on replies
tried that its confusing
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
gibhub (dot) com now gets flagged with api
can't send here or Zerotwo kicks me lol
no clue
aweet

thanks alot for copying me
lmao
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.
use for of
let options = [}
for (const {text, url} of res){
options.push({label: text, value: url})
}
....
.addOptions(options)```
Could someone help me with puppeteer?, someone experienced enough
I have never used it but its pretty straight forward isnt it?
const options = res.map(({text,url}) => ({label: text, value: url}));```
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);
Thank you; will try that rq
I don't know if the values can contain URLs?
I believe it can. Not entirely sure.
well in principle yes, but in practice a little less. I absolutely can't click on a button in an iframe. (to be more precise in 3 iframes) 
The value of the array is as expected though. It is a URL as I thought, but maybe Discord can't store values as URL's?
Unfortunately get the same error as I posted above.
let options = res.map(({text,url}) => ({label: text, value: url}));
console.log(options);
do you have more than 25 options?



