#development
1 messages ¡ Page 2007 of 1
why tf does isNaN check true if the object is empty???????????????
Probably
does so even if the object has properties
is NaN = empty = false
is NaN = adahdhaidad = false
is NaN = 2.4 = false
is NaN = 24 = true
is that not how it behaves?
I want to check for the object being a number
is NaN = adahdhaidad = false
this is true
is there not anything else I can do then?
how come???????????
wdym by checking if it's a number
I'm getting real confused
can you describe what you're trying to really do
yes but what do you want it to do
Should work with a non empty array, too
how about typeof
typeof is better thank you
how do I use typeof in an if statement again?
like
then you can just check if it's === "number"
yuh
if(typeof_amount === "number") {
}
except lowercase N
aight
heh
beat you both 
ues

google and stackoverflow are your best friends
to help me with args
I did
I searched
I didn't find anything đ˘
even stackoverflow couldn't help
lolll
and the only thing that was wrong
frl đ˘
I mean, I found the solution searching for "js variable is number"
instead of ('||')
but google has gotten worse recently 
went searching for something last month and all I was getting were referral links to amazon
show issue
that does not involve typeof though
yep, but the amount is the thing typeof checked for
ah
so the condition reads, "(if amount is zero and error is falsely) or there is an error"
what exactly is wrong with the code you shared
basically
bruh
what do you have installed?
like extensions
if you have jslint it can make things break alot
I have a thing, it asks a question
rl.question("how many times? "), async (amount) => {
if (typeof amount === "Number") return; // this just checks if amount is a number.
var Interval = setInterval(() => {
//then I use that to determine when interval stops.
amount -= 1;
console.log(amount);
if (amount === 0) return; //if it hits 0 it stops.
}, 250);
})
```and it worked until I added the typeof check instead of isNaN
WHY
nothing lol, I'm executing it in terminal
hm
"bruh" girls be like
sexism?
what is rl again?
nah
what you mean lol
idk myself just it remembered me that I once read somewhere something about bruh girls
this looks suspect
amogus sus
the world's flat
that return in the setInterval won't work by the way
if (amount === 0) return;
}, 250);
yeah jus noticed it lol
you'd need to use clearInterval(Interval)
ik ik I just used that as an example
I sent a screenshot above of what I actually do intead of return
oh yeah
this
is Interval defined
yep

to confusing for mii
klay moment: 𤨠ok
I use typescript so I donât have these problems, but arenât you supposed to check if(typeof(something) === 'number')?

OMG I
I think so
holy shit
give a sec
Also just saying, NaN is still technically a number... ironically
const isNumeric = function (_float) {
return /^-?\d+$/.test(_float);
}
I just started getting the REGEX
oh no
Wtf why did you make a regex for that????
might have to hardcode it to block it
BECAUSE NOTHING ELSE WORKED

no no no, the typeof is fine
please use something like typeof x === "number" && !isNaN(x)
Wouldâve taken you a quick 10 second google search or just testing typeof(10) to figure it out instead of looking for an obscure unreadable regex
and regex are not the fastest way
I actually have least 3 regex functions in my script right now just cause I couldn't find anything else
Regex is very slow in comparison to a quick type check yeah
I avoid regex at all costs personally
holy shit it worked
If youâre using regex a lot, the probability is that youâre likely doing something wrong
you're amazing @wheat mesa
yeah 100% lol
Regex is good in some situations but it can be avoided most of the time
my longest regex is prolly the IP check
/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
it works so who am I to complain lol
imb4 someone suggests you write your own ip compiler
I need it tbh
but too lazy to make it
I mean you could use that or you could split by dots and try to parse them as valid numbers 
But regex is probably fine for that
yeah now have fun figuring out what numbers make sense there
Regex is perfectly fine for that use case
I feel like that would be harder to do than it was to do using regex
my worst regex use? prolly an ip correction thingy
you should see some email validators
saw one that was 170k characters long
ayooo
That... is also probably not the right use case for that
plus it looks... rather
not nice
I have not seen a ânice lookingâ regex in my life
I mean you can make it look good
I could shoot you can example
if I find it
How about (?:--?(\w+)(?:=(?:(\w+)|"(.+?)"))?)
also how would I make a range check? if value is less than 250 and larger than 5000 for example
ah yes, regex
Less than 250 in length or as a value
as a value
Just do a simple of check
in regex?
If*
Also your sentence doesnât make sense actually
Less than 250 AND larger than 5000 isnât possible
lmao
how come?
if value is less than 250 don't execute, and if it's larger than 5000 also don't execute
also found some rather nicely readable regex, it's neat if you sort it
You said AND not OR
my bad
Important distinction to make :p
Just do exactly as you said
if(value < 250 || value > 5000) return;
I'm pretty braindead today
/((?:.[\w_.<>]*)? ?(?:.[\w_.<>]*)? ?\[(?:as)? ?(?:.[\w_.<>]*)\])? ?\(([^*?"<>]*):(\d+):(\d+)\)/
this regex is to pick apart an error stack frame
well. A specific frame
I've seen worse
I bet
github keeps recommending me node-ipc and peacenotwar in the explore tab
I think this is a sign
what
would you rather use
ESLint or Jslint
ESLint since I'm more familiar with it
Maybe JSHint if I learned about it
But ESLint has a lot more knobs and stuff so it's attractive
ty
either one probably works
I feel like those frameworks werenât really designed with ts in mind at first so it might be finicky
But Iâll look into it
I was about to set up my pc but tornado sirens are going off so I suppose Iâm gonna have to delay that 
@sudden geyser any good bottums name?
what's the bot's subject
probably gonna make it an economy one or like gacha
moodae - a cow parody of mudae
then how about treasure since that's an actual name
hMMM
or you could just flip open the reliable greek dictionary, flip to a random page, and look up a word in there
emeraldas
good candidate 
Hakos
this is true for real lmao
why greek word sounds so cool
ÎşĎ Î˛ÎľĎνΎĎΡĎ
kubepvntns
I don't know about you, but I'd take that bot name before anyone else does
kubernetesâ˘ď¸
LMAO
kubepvntns best name
anyone know why Slash commands wouldnt show up after an hour in a non guild_ids server? I invited my bot with Application Commands scope as well and it still hasnt appeared
alright. Just tested and im getting 0 errors when i push my code. I reinvited so now ill just wait a bit
is there a way to make webstorm format automatically/on save or do I have to use prettier like I would normally do on vscode
Did you even push them globally?
Not accidentally to a guild?
How do i get image using axios? res.image is enough right?
abcdefghijklmopqrstuvwxyz
I think so? isnt that just if you dont include a scope?
nvm that helped me. I figured out what i did wrong
depends on what you want to do with it, seems to me like the image prop on that is just a url
actually sending a curl request to that url seems to give the binary data back
Alright
The invitation scope doesnât differentiate between global and guild commands
Thatâs just up to you how you register them
curl?
defense curl
iron defence is much stronger.
curl is a linux command line program
is there a good way to write integration tests for discord bots?
because i was trying to get the image using axios, but nothing happens
We have junit
Idk what for js
what is the url you are fetching with axios?
this is how i do ```js
Axios.get('https://randomfox.ca/floof/?ref=apilist.fun')
.then((res) => {
const embed = new MessageEmbed()
.setTitle('FOXY!')
.setImage(res.image)
.setColor('RANDOM')
.setTimestamp()
message.channel.send({embeds: [embed]})
})```
i have a fancy pipeline now. it wants unit tests and integration tests
does axios return json by default?
if so that should work
its strange cause the embed not showing
Don't think u can do that for a discord bot
Since it depends on user interaction not just some automated tests
console.log res and see
and read axios docs
okok
i was thinking i could save a request and send that to my interaction endpoint, but i dont think that works if i'm logged out
or the security token thing will expire
Fill it with unit tests, they'll be pretty enough to assert it's working properly
Since commands are isolated by definition
then i shouldn't really have an integration environment
console.log not showing too
straight to prod
Ye, integration tests feel weird for discord
Just make sure all commands and modules are working (unit tests)
If all pass you're dog
let RN = Math.floor(Math.random() * 100) - 1
if(RN > 25) {
} else if(RN > 50) {
} else if(RN > 75) {
} else {
}``` is this right or na
you should work backwords
if(RN > 75) {
} else if(RN > 50) {
} else if(RN > 25) {
} else {
}
oh
what you have would return the first check anytime over 25, even if 50 or 75
i see isee thanks
no worries đ
What is this code in md files
---
lang: JavaScript
syntax: javascript
title: JavaScript is to Java what Cupboard is to Cup!
author: umng01
---
What that block is called?
How do I get an electron app to log to the WebStorm console instead of the application's devtools console?
why webstorm?
fair enough. if you use most of the technologies it supports
I usually use vscode for stuff like this, but I wanted to give webstorm another chance
yea, it doesnt look bad. i hadnt heard of it before đ
the only problem being my console in devtools keeps getting overwritten which means I can't see my logs
well, the electron app is logging to its own devtools window
but there's a warning about a security issue (that I don't care about at the moment) that keeps overwriting whatever I log to the console
I can see the data pop up for a brief moment, then disappear in the console
not sure if it will help, but you could do this:
const {createWriteStream} = require('fs');
const {Console} = console;
// new FileTransport({filename, options});
class FileTransport extends Console {
constructor(file_options) {
const {filename="", options={}} = file_options;
const log_stream = createWriteStream(filename, options);
super({stdout: log_stream, stderr: log_stream});
}
}
to create an instance of a custom 'console like' object, that you can do 'console.log' etc with, that will save the output to a file
I might resort to that if I absolutely have to, but I'd prefer to use the built in console if possible
here's a gif of what it's doing
you can see the console get rewritten
it's supposed to be logging the form
which I've seen it do a few times, it just gets pretty much immediately overwritten
ah
how would one cancel said event
I never really do frontend but I'm hoping electron can get me more into it
function logSubmit(event) {
log.textContent = `Form Submitted! Time stamp: ${event.timeStamp}`;
event.preventDefault();
}
const form = document.getElementById('form');
const log = document.getElementById('log');
form.addEventListener('submit', logSubmit);
<form id="form">
<label>Test field: <input type="text"></label>
<br><br>
<button type="submit">Submit form</button>
</form>
<p id="log"></p>
^ html for that js
electron-forge is a nice package
it basically handles the build/install/updating etc etc
using preventDefault and now it logs, thanks!
yay! no worries đ
i added a markdown -> html converter to help make a help page quickly
but now i have an easy way to load child windows that show markdown ~ which is nice
For some reason, presence doesn't work on my ubuntu server?
what type of presence
for your account or a bot account
bot account
can't do that
dnd works itself
yeah
getting someone elses info or setting your own?
nvm then
like luca
you get any errors?
and can you show your code
sure one sec
you might be trying to set it too quickly if you're changing it a lot
but that would trigger a ratelimit error so you'd probably notice that
module.exports = async (Bot) => {
games = Bot.config.presence.games
setInterval(function() {
game = games[Math.floor(Math.random() * games.length)]
presence = {
"status":Bot.config.presence.status,
"activity": {
"type":game.type,
"name":`${game.name} | ${Bot.guilds.cache.size} Servers.`
}
}
Bot.user.setPresence(presence)
}, 30000)
}```
node.js still accepts them
use a declaration like let
games = Bot.config.presence.games
and it works on windows
Games is an array, with objects in it
like this
[{"type":"WATCHING", "name":"jj2neat!"}]
// Set the client user's presence
client.user.setPresence({ activities: [{ name: 'with discord.js' }], status: 'idle' });
don't think so, and just because nodejs accepts it doesn't mean you should get into a habit of that btw :p
you should ALWAYS declare variables with one of those keywords
always const unless you need let ~ imo
^
^^^
I got into the habit of that months ago
but I coded this little module about a year ago on v11
var if your a heathen who likes to live on the dark side đ
or v12
there are some very niche use cases for var
blasphemy!
does var use more ram then let?
and yeah I figured that out when I had multiple games running on my bot
what about huge database objects
function roughSizeOfObject( object ) {
var objectList = [];
var stack = [ object ];
var bytes = 0;
while ( stack.length ) {
var value = stack.pop();
if ( typeof value === 'boolean' ) {
bytes += 4;
}
else if ( typeof value === 'string' ) {
bytes += value.length * 2;
}
else if ( typeof value === 'number' ) {
bytes += 8;
}
else if
(
typeof value === 'object'
&& objectList.indexOf( value ) === -1
)
{
objectList.push( value );
for( var i in value ) {
stack.push( value[ i ] );
}
}
}
return bytes;
}```
^ code to get the rough size of an object
src: https://stackoverflow.com/a/11900218
ew var
an example of why var is bad btw:
yup
compared to let
the bad thing is var in message listeners
^ this imo
that's why that array got null in it
you should never be able to access a variable before its declared
whereas if you used let you would find that pretty quickly, since it would error
not that I know of
it's still bad practice in 99/100 cases
it's also function scoped compared to let's block scope
// WITH VAR
console.time("var-time")
for(var i = 0; i < 500000; i++){}
console.timeEnd("var-time")
// WITH LET
console.time("let-time")
for(let i = 0; i < 500000; i++){}
console.timeEnd("let-time")
var-time: 2.521ms
let-time: 1.633ms
thing when using let would be limited to the block scope it's in
lol thats hax
probably not the greatest way to measure performance tbh
as its a loop
indeed, but it shows that var is indeed slower
although var seems to be consistently slower on my machine too
https://stackoverflow.com/a/40070682
decent writeup there on the differences etc
not really surprised, it's older and hasn't been changed all that much
I mean it makes sense from the interpreter
I'm not an expert on interpreters or the implementation of v8, but in theory you would think it's fundamentally the same thing
it's likely because it has to be allocated for longer since it's hoisted to function scope
seems like a reasonable assumption
there could have also been some additional performance improvements made that for some bacckwords compatibility reason var cannot have
also an interesting difference, but small enough to be explained by differences in system processes
after a few tests it seems like let is very very slightly faster
I'd need more data to make an actual assertion though
and a better testing method
more stable environment
etc
i wonder if for looping down instead of up is still faster
javascript has some weird quirks when it comes to speed
for (let index = array.length; index; index--) {
const element = array[index];
}
for example
I don't think so but I could be wrong
from an interpreter standpoint I would think that they both use while loops internally
// WITH VAR
console.time("for-up")
for(var i = 0; i < 500000; i++){}
console.timeEnd("for-up")
// WITH LET
console.time("for-down")
for(let i = 500000; i; i--){}
console.timeEnd("for-down")```
oh fml, still var there
lol
you should try for and while
const arr = Array(50000000);
console.time('up');
for (let i = 0; i < arr.length; i++) {
}
console.timeEnd('up');
console.time('down');
for (let i = arr.length; i; i--) {
}
console.timeEnd('down');
results when arr has 5000000 elements: ```
up: 4.093ms
down: 3.16ms
results when arr has 50000000 elements: ```
up: 20.957ms
down: 20.291ms
seems to be more negligible with the more loops that are done
yea thats what im seeing too
in reality it's not gonna affect it much
yea, considering were all using discord.js anyway 
lmao
there should be zero difference between those
it's probably the environment
you're likely just seeing v8 being quirky
theres a clear difference between for/while/do-while though
also this is probably just a fluke but prefix is consistently faster on my machine ```js
const arr = Array(500000);
console.time('suffix');
for (let i = 0; i < arr.length; i++) {
}
console.timeEnd('suffix');
console.time('prefix');
for (let i = 0; i < arr.length; ++i) {
}
console.timeEnd('prefix');
suffix: 2.433ms
prefix: 1.512ms
faster on mine too
but again the difference fades with more loops
it's probably something weird with the timing tbh
its close though
yours seems to have a wider range
oh, it was slower that time! đŽ
lol
lmao, well, moral of the story: do more loops?
const arr = Array(500000);
console.time('loop-1');
for (let i = 0; i < arr.length; ++i) {
}
console.timeEnd('loop-1');
console.time('loop-2');
for (let i = 0; i < arr.length; i++) {
}
console.timeEnd('loop-2');
loop-1: 2.323ms
loop-2: 1.549ms
const arr = Array(500000);
console.time('loop-1');
for (let i = 0; i < arr.length; i++) {
}
console.timeEnd('loop-1');
console.time('loop-2');
for (let i = 0; i < arr.length; ++i) {
}
console.timeEnd('loop-2');
loop-1: 2.356ms
loop-2: 1.537ms
it's just the environment
what does ++i vs i++ do exactly
yea same, second loops faster here
nothing in js
ah
++ increments. either before, or after you read the value
iirc in c++ ++i mutates the reference to i but i++ creates a copy of i and then mutates it
let value = 1;
console.log(value++);
console.log(--value);```Both log 1
```js
let value = 1;
console.log(value++);
console.log(++value);
```First logs 1
Second logs 3
(for c++)
once the code is compiled to asm there's no difference though
in terms of performance
Canât wait to get into more complex performance stuff
what about creating a copy of an array
I love this type of thing, just havenât learned enough about it to be knowledgeable
Iâm not sure if js takes arrays by reference or copies
I would assume it creates a copy because... itâs js
reference
Are js references similar to Java
its very weird, tried making a connect4 ai and it was like
let arr1 = ["test1"]
for() {
let copy = arr1
copy.push("test2");
}
Where everything but primitives is âpass by referenceâ
arr1 includes test1 and test2
(Though technically Java is ALWAYS pass by value)
im sure this is the case yea
could be wrong đ
Im not very technical in javascript, but I do know my way around a workplace, classes functions objects and more stuff like that
All of my formal education is in Java
theres tricks that I pick up on but ive never really learned the most efficent ways of doing things
Iâve never really looked into the way js handles references and that sort of thing
Ok so from what Iâve gathered on a quick search, all primitives are assign by value, and objects/arrays are assign by reference
So pretty similar to Java
I really wanted to learn java but it just seems complicated
especially because I started in javascript
just very.. different..?
Java isnât that hard tbh
I use javascript and python, did abit of ruby
Itâs definitely gonna be different if youâre not used to OOP and statically typed languages

But itâs an oddly satisfying structured harmony
I used to hate Java but I actually quite like it now
$ruby.is_a?(Object) {|oriented| language }```
^ prints true
best line of ruby code ever!
that line literally won some ruby code contest in 2013 lol
i've been in awe of it since đ
Is it kinda like discord.js in a way
Bottom line, I would definitely recommend it
like how the objects work?
Objects are everything in Java
and classes im assuming
Yes, classes are skeletons for objects
Or factories of objects would be another decent comparison
People bag on Java a lot (cough cough fake) but itâs honestly a great language to learn
Extremely useful, easy to learn, and teaches a lot about programming concepts
Enforces organized code (most of the time at least)
and faster id assume then javascript
Depends on what it is
and more powerful
V8 is really fast
Java is mostly faster than js just because itâs (mostly) compiled
But I wouldnât necessarily say itâs more powerful than js, thereâs pros and cons compared to an interpreted language
Though Java is sort of interpreted
okay
Nodejs uses bytecode technically right?
nodejs uses v8, the same engine as chrome/chromium/webkit
v8 uses multiple different compilers depending on the situation
Ah okay
Itâs possible but I think youâd lose your mind before actually getting close
All ends up as bytecode either way according to that 
you dont really "compile to assembly"
Well, they generate assembly
assembly is just a way of representing bytecode
c++ looks way more complicated then java and js
It is
Thereâs a lot less lenience in C/C++ than there is in Java and Js
But once you know how to use it, itâs a pretty nice language
Especially considering the speed
every language has its purpose
you use the best tool for the job
C and C++ are the kings of most modern programming languages
Theyâre used basically everywhere you could think of
V8 is written in C++
Windows is probably a mix of asm, C, and C++
same with lots of parts of linux and mac
C++ is basically the best trade off between low level code and sanity
large software is made up of lots of smaller components
windows is not one big thing, its a mix of thousands of small things
each thing can be done by different teams and people
and also different languages depending on the situation
im guessing c++ is natively installed on win
Writing a large performance critical program with a few hundred thousand lines of assembly? Nope. Use C++ and save yourself some sanity
not really afaik
to compile c++ on windows you need to install a compiler like cmake or visual studio tools
I donât think thereâs a native C++ compiler on windows yeah
The OS itself is already compiled and ready to go so thereâs no real âneedâ for a compiler to be natively installed
Since 99% of people wonât ever use it
yeah even on linux
most linuxes do include stuff like gcc, but you likely still have to install build tools to be able to compile stuff
c# is pretty popular for discord bots
Itâs a very good choice for bots
not as much as python and js tho
Itâs more in depth though
i rarely hear about it
Since C# async/await is a bit more complex than js and py
Iâd say itâs probably the 4th most popular choice for discord bots, behind js, py, and Java
C# is pretty much the best choice for writing software to run on windows
C# + dotnet
Made for Windows by Windows 
Itâs got all the tooling youâll ever need for windows software
ever wondered why 90% of games out there require you to install vcredist/dotnet/etc
C# is also a really popular game development language
unity
what does UE use
C++
ok
Most competitive games use mostly C++ for their games due to the performance being critical
But indie games in particular are largely made in C#/Unity
Stardew Valley was made in a mix of a custom game engine and Unity with C# by one dev
Really impressive
Good games that are made singlehandedly never failed to impress me once I figured out how difficult the process was
also, zun
Before I started programming I would probably take a look at stardew valley and be like âThat doesnât look like itâs that hardâ, but now I realize the amount of depth, complexity, and thought that was put into that game to make it a masterpiece
all hail zun
lol
yeah, cant talk about this without mentioning him
dude made an entire game series with 10+ games by himself
wow
Thatâs insane
and composed all the music by himself as well
Since 1995,[1][2] the team's member, Jun'ya "ZUN" Ĺta, has independently developed programming, graphics, writing, and music for the series, self-publishing 18 mainline games and five spin-offs as of May 2021
I think it was 3 people, one dev, one music, one art
18 wow
But I could be wrong
Oh nevermind it was just Toby Fox in the beginning of undertale
while the west is busy partying and drinking, asians are working on their dreams and goals 24/7 for decades nonstop
Yup
Thereâs big cultural differences between western culture and Asian culture that contribute to things like that
Anyways though, Iâm gonna catch some sleep before I have to wake up in 5 hours. Thanks for the conversation, it was really interesting
if user want to execute warn command what's the permission required? MANAGE_MESSAGES or MODERATE_MEMBERS?
I want to make some contribution for a github public repo.
I directly cloned that repo, without forking it first.
Now I had already made many changes.
But cant push it.
What do i do?
Is it possible to fork it now, and change the remote on my machine?
i hope one day i will be able to reach that level
recommended: moderate
you can try role-based action commands
man cmon don't play into that model minority stuff. That's a harmful stereotype 
so you're saying bros wrong?
Hi guys,
I need a bot which assign automatically a role by holding specific tokens in BSC
I believe theres a good bot for that
called Grape
do you have a link for that? there is alot of Grape bot out of here
How do i get the message.URL of the embed and post it to MessageEmbed?
.setDescription(`Your suggestion posted in **[Suggestion Channel](${msg.url})**`)``` gives me error
```js
Scheme "null" is not supported. Scheme must be one of ('http', 'https').```
https://grapes.network/ i believe
we use it in a server i mod
completely wrong link. this is just grape network seems
this is the nicest website ive seen so far ngl
whats this error covering the entirety of my console
The var message you mentioned and the one I see in your code are different
Is that supposed to be like that?
message.url is not msg.url
property url of msg is null
Cloudflare ban
i am asking the same thing
HTTP 429 error: skill issue: you didn't throttle network and do request everytime the program is refreshed, and now you are rate limited
or u use replit
man literally copied the whole html in F12
that's exactly what happened
i mean you can always kill 1 
Not Replit i guess
thanks for the html bro I needed a template for my website
Context missing.
can i automate replit to auto kill 1 on error
dk
assume lib "discord.js"
assume lang js
define async fn onMessage(message: DiscordJSMessage)
get message.Mentions.Roles.First -> roleId
await call discordFetch(guildId) -> data
data.users filter (roles in user has roleId) foreach user:
call sendMessage(user.name)
"i use python"
u always give pseudocode
lemme fix
Bro this ain't rust change that fn to function right now
define async function onMessage(message: DiscordMessage)
get message.Mentions.Roles.First -> roleId
await call discordFetch(guildId) -> data
data.users filter (roles in user has roleId) foreach user:
call sendMessage(user.name)
when command.IsUsed -> call oneMessage(...params)
@earnest phoenix
ig they gave up because my code is unintelligible

i'm making a login system and I need to be able to lookup users based on their email or username
how can i basically combine await accounts.findOne({ email:req.body.email }) and await accounts.findOne({ username:req.body.username }) into one statement?
i want to check if **either **the users username or email exists in the db
afaik you can do that in one obj,
findOne({email, username})
isn't that find both?
yeah both
you can try existOne
for each condition
wait lemme lookup api docs
guess im wrong in understanding her question 
i wanna find either one or the other
login page with allow either usernames or emails
alrighty
take the latest one
but you will have to implement in your language with whichever library you are using
lel sorry, you're right
@oak cliff -needdev
-needdev
You seem to be asking for something you don't have experience for or something that hasn't been done yet, but really need for your bot/server.
You can hire developers from Fiverr or Freelancer to code the things you need for your bot/server.
@wide widget ^

Hey, I'm aware that discord is moving to slash commands in april
python
How do you think that they're gonna inforce it? And not break let's say leveling bots in the process
How would you get message intent
pls help
đ discord api
you didn't ask anything
no, you didn't state your error
no info = no help
it is music bot like rythm
oh god
You have an invalid syntax. Also Python đ
in what kind of mind state did you think { and ( are the same thing?
range{len{cogs{)]
can you fix
idk what to say, how did you reach such point?
I mean, it wasn't by copying probably
your issue is that you mixed ( and {
do you know how programming works or is this your first time?
@wide widget I won't go and fix it for you, you'll be doing that yourself
What is yall favorite programming language
No language / library wars - anyone involved will be muted.
careful
we will get topgged
Assembly x86
english
you will get topgged instead for minimodding 
lol
code
nobody ever gets punished for that anyways
Hi, i am looking for a bot verifying NFT holders of BEP 1155 on Binance smart chain (similar to collab.land). Is there an existing solution?
aye... that's like 50% of this channel anyways
what
don't think there's a bot for that
but you could try using the search bar on top.gg
is it possible to transfer an advanced command handler with cooldowns, and all sorts of permission checks like botInVC and isEnabled
to slash commands
and is there any reasonable resources where I can learn more on implementing them, because it seems very very different
needing to build a slash command like an embed
Well the handling of slash command responses isn't different, at least code wise
You just need to use the proper methods and need to add slash command registration/removal to your handler
Of course, that's why you register them
They will fail if you don't respond properly
Oh god, no!
Deploying global slash commands can take up to an hour or more to be pushed to all guilds
oh god
There's no need to remove them
what if you remove the command all together
should I make a command like /remove global command "play"
or something
If you have the bot scope (an active gateway connection) your app will be shown as offline and users will receive a "interaction failed, didn't respond" eroor
discord just had to make this change
this gonna make lots of ppl stop coding bots lmao
Nope, this is actually way better than a gateway connection
Yeah im not really sure about the backend of d.js
but I'd assume the gateway connection is where the heartbeat is
Interaction (like slash commands) will actually send a request to your endpoint, don't require a gateway connection, either you answer to the request or not (interaction failed)
okay
No they don't
You can still use the scope bot
and/or application-commands
so a command like /add global command "name" and /rem global command "name"
is a must
for stuff like that
I don't see any sense
what if you add more guilds
You register the commands in your code once
They are deployed after anywhere
At any time
yes, but if your in the middle of coding something
Until you remove them again
and you decided to delete lets say an 8ball command from your code
Im sorry im trying to wrap my head around these new methods
You can deploy guild commands (only available in a guild of your choice) to develop and test commands, then deploy them globally
When using common commands in modules you can also add properties let's say to deploy a command in one guild
If you don't need a command anymore you delete it, yes
okay
so basically just like a regular command handler, but you also want to load the commands one time
like:
cmds.map((cmd) => {
build slash command here
});```
An example:
This would only be deployed to guild X
Requiring permissions Y
My command handler will register them once the bots start OR update (if needed) if they are already registered
so like in the ready event
Once guilds are null in my case, the command will be deployed globally
okay thats cool
I'm calling the registration in the ready event, yes
Only after that you have access to all guild objects
Also to guild commands etc.
okay im starting to understand abit more now
But as I said you don't necessary need a gateway connection
You could also register them once
manually
oooof
No gateway connection, no ready event, nothing
my bot invite links are showing "Invalid Permission(s) provided" but I have not changed anything can someone please help
Yeah that's no must
You can still use the normal gateway connection and application.command scope
okay
do you know the new event for slash commands?
isn't it interactionCreate or something
Yeah lots of properties messages come with are also available for interactions
author actually isn't one
its interaction.user
Aye
okay thank you for the help
np
ima make a small bot with a test command handler
đ ik
You will need to watch a few examples here and read the docs to get into them accurate
And play around a little bit with guild slash commands
you register on your test guild
btw. registering guild commands are instant available
okay thank you
also true, yeah
any yall do freelance work on any site like fiverr/upwork/flexiple ? Wondering what like the experience is for the developer đ
from what I heard, terrible
yea, but bad news travels quicker than good, so folks always hear about the bad stuff first đ
i too find lots of negative reviews on such services
I believe the issue comes not from the platform, but from having to interact with customers
Thank you but i could not find a solution. Is there anyone willing to develop such solution?
~ is currently seeing freelance work ~ if your paying feel free to dm me details on your request lol
#development message details
this isn't a place to find developers or advertise yourself as a developer
please refrain from doing so
lol sorries, wasnt purposely trying to advertise đ
been on fiverr for over a year
never got a single job from there
Market is oversaturated for bots at least
every job I've ever had came from connections. I recommend just reaching out on discord in servers that allow it
yea, thats fair. most of the jobs i've got has been through word of mouth etc
that sucks! is this for bot creation services? i looked on fiverr and there are WAAAAYYYYY too many people clearly selling edited open source bot code for pennies lol
for coding in general






