#development
1 messages · Page 1951 of 1
so the best solution would be to make another collection which contains sensitive data about the user where then you can make a rule that only the user can read the sensitive document
basically
firebase pretty stinky
Supabase is a pretty solid (also cheaper) alternative
because RLS is so fucking nice
what is firebase and supabase useful for
authentication iirc
so they just streamline it for you?
yeah
the concept is good but firebase makes rules difficult to work with and lacks a lot of elements
bc its good that users can access it
so no serverside stuff
well yes but less yk
like its just less server load
but the server is still somewhere
but like for example
when a user creates an account
it doesnt need to talk to YOUR server
it just does everything clientside
fuck tho hmmm
so it's useful for delegating responsibility to firebase?
2 options then
i guess?
i mean it has other fratures
featurss
its great for apps in specific
but 2 options for me: either just to completely serverside or figure out this rule stuff
what do u guys think?
hmm
firebase is free...
so firebase is useful when you don't want to manage a backend and all its complicated stuff
umm
you still have to i think
just less work
i could also just scrap the js and move to python
and then just use mongodb? ezclaps???!?!
i mean i added google auth tho
but i could just scrap that
and just hash passwords with salts??
but now you need an iPhone
what
or a phone
I didn't have a phone until I was 16
it was so annoying how every site aggressively pushed 2FA
particularly discord
firebase is free for a bit afterwards it paid per transaction / read and write
- bandwidth
TRUEEEE
i just decided to fuck it all and move to python and mongodb
ezclaps no more rules
but you were probably paying for that server without it anyway
i have a server yeah
fuck firebase ngl
i mean tho
how can i implelement google auth tho
Try finding a library for it
Good chance it's written by Google
I tried using Google auth once and immediately backed out
if it makes sense for your platform
umm
the platform is to practice really
oh fuck i need to store images!! how the fuck do i do that?
practice what 👀
coding..
and does the site have relationships with discord? if not, I'd advise against implementing Discord oauth. It's like implementing GitHub OAuth on a cooking recipes site
isn't there a way to make this in a few lines?
db.add(`silver_${message.author.id}`, 1);
db.set(`giantt_${message.author.id}`, true);
db.set(`archers_${message.author.id}`, true);
db.set(`minions_${message.author.id}`, true);
db.set(`arrows_${message.author.id}`, true);
db.push(`common_${message.author.id}`, "Giant");
db.push(`common_${message.author.id}`, "Archers");
db.push(`common_${message.author.id}`, "Minions");
db.push(`common_${message.author.id}`, "Arrows");
db.add(`cards_${message.author.id}`, 4);
db.push(`all_${message.author.id}`, "Giant");
db.push(`all_${message.author.id}`, "Archers");
db.push(`all_${message.author.id}`, "Minions");
db.push(`all_${message.author.id}`, "Arrows");
db.set(`deck1_${message.author.id}`, "Giant")
db.set(`deck2_${message.author.id}`, "Archers")
db.set(`deck3_${message.author.id}`, "Minions")
db.set(`deck4_${message.author.id}`, "Arrows")
``` forEach, function or with "i"? ( *for ( let i of array)* )
Where you find patterns in your code is where you can substitute it for loops.
how does mee6 let you create your own version of their bot via the website?
hmmmm
can new application be created programmatically?
triviabot was bombarded with 13000 commands in the space of an hour 3 days ago
i guess it says something about scalability that i wouldnt even have noticed if i hadnt seen a spike on the graph
13k commands kekw
revenge of the spammers
it looks like it just laughed at them and kept on running lol
epic c++ scalability
Is it creating new bot applications or just processing commands differently
I'm more curious about what Mee6 is doing
it;s a new bot. it's not verified like the original bot, but it's the same bot just skinned differently
i saw someone else had it
does it require you to give them a token?
maybe it did. i'll have to double check with them to see what they did
that would work though
Is is the only difference between C++ struct and class is that members of struct is public by default and class is private, right?
Isn't struct a temporary class?
Like, something to be used in that context and then disposed
My condolences 😔
Yes
I highly recommend https://discord.gg/AGWYXFA7 for C++ questions btw, you’ll get a much faster response there
I write semantic html not css
Correct.
ok so how can i close that div before the center div?:
<div class=container style="background-color:#000">
<div align=center>
<img src=<%=bot.search(user.id).avatar%> class="mb-3 mt-4 rounded-circle"draggable=false height=160 width=160>
<h1 class=app-slogan>Welcome back!</h1>
<br>
<h1 class=app-description>manage ur servers</h1><br></div> <!-- this div closes the center div,but i want it to close the container -->
<div class=container>
<div class="mb-3 input-group">
<input aria-describedby=basic-addon1 aria-label=Username class="form-control search" id=search placeholder="search smthn"></div>
what in the world
Don't you need to end stuff with a semi colon with ejs
so it knows when stuff ends?
or is that optional
Optional
ah ic
I think your divs are messed up unless I am looking at it wrong
That code snippet is poorly formatted so its hard to actually tell
Yea
you're missing 2 closing divs
<div class=container style="background-color:#000">
<div align=center>
<img src=<%=bot.search(user.id).avatar%> class="mb-3 mt-4 rounded-circle"draggable=false height=160 width=160>
<h1 class=app-slogan>Welcome back!</h1><br>
<h1 class=app-description>manage ur servers</h1><br>
</div> <!-- this div closes the center div,but i want it to close the container -->
<div class=container>
<div class="mb-3 input-group"><input aria-describedby=basic-addon1 aria-label=Username class="form-control search" id=search placeholder="search smthn">
</div>
</div>
</div>
There that is better formatted
no problem glad I could help :p
close that br tag pls
it hurts when you see normal html code after closing every single tag in react
Can a bot change their own pfp for a server? If so, how would I do it? Internet isn’t being very helpful rn.
happy 2022 folks 😘 ❤️
https://sourceb.in/hD6spS6No3
snipe command - issue is that it always says no message to snipe even if I just deleted a message
I mean that is only 3.6 commands per second
which for even a very slow webserver is basically nothing
hey yo, long time 😛
can you tell me how you make your graph? it looks really similar to the graphs i've been making the past few days. 🙂
chart.js and jquery frontend, mysql for the backend with a php script
the bot processes submit counters to a set of tables every 15 minutes, then a set of mysql views represent that data in a way that lets the graph be displayed without having excessive data points
less data points the further back you go, e.g. 15 min, then hourly, then daily, then weekly
still way more than the rate limit would allow if the bot replied to them all
I mean if it was a webhook interaction the bot could respond to them all :P
so that information is shown in some frontend client, not in your bot itself?
sort of
my bot has three parts plus a database server
theres the actual bot, then theres the dashboard, and admin panel
docker?
the bot is a set of instances of a C++ program, it has no web stuff in it
the dashboard and admin panel are a set of php scripts that are run under apache 2.4
they all use the database (mariadb) as a central point of truth
so the bot process can update user/channel cache tables etc, and scoreboard tables
the dashboard can read them
both dashboard and bot can update guild configs
i see
im not using docker or virtualisation
i probably could/should use docker eventually
no need yeah
it'll get to the point where i have to scale horizontally soon
well, when i get to about a million servers lol
and then i could do with docker images for deploying a multi-master mysql, or a varnish cluster for the web stuff
i have everything running in docker containers. 1 for each bot, 1 for each website, 1 for mongodb, 1 for nginx, 1 for netdata monitoring. etc
interesting
so i managed to write a little class that is able to grab the docker container id, which i can then use for polling container specific information from an internal network to the netdata server (which normally requires auth)
^ the graph the bot sends (one of)
thats a lot of cpu
my cpu graph is pretty much boring
^ possibile charts to grab
because its flat lol
the bot.xxx ones are awesome af
spent the entire day yesterday figuring out how to send statsd pings to my netdata server (wasnt working, cause netdata binds to localhost and not 0.0.0.0, which is required for docker)
cant you ping the docker host ip 172.x?
thats why you reason netdata's how to setup with docker page
Netdata finds all your running docker containers.
ive been using docker for years lol
netdata is also dockerized, which makes it require more things, but yes, it reads all container info
I mean yeah you need to create the docker network.
Which I didn't do for my netdata just have it running normally.
yea i debated just having netdata run locally, but i wanted my nginx to resrict the port

Sure let's do it
sure 🙂
it literally is a cave ig, its in an 18th century cellar
oohh nice
lmao
i converted it from a horrible hole in th ground into a place im comfy coding in 😄
imo you should paint the walls a super light grey, and then get some rgb going all over the everything! 😄
whats the point of a cellar if you cant make a racket 😄
out of curiosity, why the 2 rigs? is one a server rig?
not had my Z5500 set up for years
the one on the right is literally a server, yes, with a ups on its right
ahh yea i see it peeking out 😄
what does it serve?
thats how it looked before i put the rest in
boring af 😄
Isn’t it fucking cold down there?
and that monitor and old computer to the left of the server, those are a retro computer from 1984
but i cant keep the retro computer on, it has an electrical fault in its psu and it cripples the lan lol
Old photo but basically my setup
isnt airdropping for crypto?
got a thermostat on my desk, it currently reads 24.9c 45% humidity
its pretty warm lol, server kicks out a lot of heat
my gosh 25 is almost too hot 
im careful to monitor the humidity in here, got a big-ass dehumidifier
i like your desk mat
I don't use it it's too tiny lmao
Yeah that’s what I would be concerned about to
black, white, red. best color combo for a setup imo
Bought it thinking it was bigger
desk mat lol, i donmt have room for desk mats
😄
i have a drawing tablet i barely ever use
lol, idk if i have a pic of my setup after i moved to my new house
true
random question: any yall have any idea how to level out a floor in a house i dont own? 😄
I recently added some led stripes to my desk and it looks so cool but is so unnecessary
Photo of it now
yeah the floor in here was literally uneaven dirt.... heres what i did 😛
Hmm since it turns out to be a presentation…
pallets.... then i got boards and screwed the boards to the pallets with an electric screwdriver
painted and varnished them all
Wait I got more lights
RGB?
Lights inside the furniture looks fucking sick
niice
RGBWW
oohh yea thats dope af
Warm white and cold white LEDs as well
not the best pic, but its the only one i can find from right after i moved in lol, can still see my construction in the hall 😄
As common cheap LEDs are not really truly to colors
I mean I renovated the house a few years ago, so everything still looks "new"

not sure that really counts though.
where is the pc? 😄
where is the keyboard?!
Of course I put it into the furniture my own
Zoom into the photo, it has a lighting name on the case behind the chair
At the end the result matters.
It’s nice to see what people can build using their own hands what other people would call irreparable or useless.
+10 to living skills with those lights now
lmao aye
I do but not inside 
If it would only be that easy to increase the driving skills…
I mean have you crashed while texting here?
Gaymer
why if i fetch a user with djs v12 it only maps me 4 of the actual 66
const guild = client.guilds.cache.get(message.guild.id);
guild.members.cache.forEach(member => {
console.log(member)
});```
is it because of cash
Indeed it is
cash?
cash
*cashed
I am trying to help someone here
so stfu
cash
owh so to get all people in a server i should find the user?
You need members intent
One thing to start with is to enable the proper intents such as the Members intent
also why are you mapping every user
i wanted to add a randomizer feature to a game i am developping
menacecraft pocket edition
Well I can tell you now whatever you are going to do will likely get you ratelimited
i want to give one random user in the server an ingame currency gift if the other doesn't accept the gift
it's a server of my friend, they only have 66 people and i added proper timeouts to it
If you wanna get a random user why are you looping
message.guild.members.cache.random()
let's hope djs did one thing right
it still exists yes
Just do what that person above said
you can just use .random on cache to get a random user
Saves you the trouble of doing all that yourself
scheduled to be removed in v14 to fuck developers again
Most likely not
I am sorry since Erwin's gone i have to yell at everyone to use detritus
alirghtty, thanks cuties!
lol never, yet
you know you're in too deep when driving while helping beginner bot devs get their bot to start
I know, I’m a good boy, too good boy probably
I mean like @quartz kindle … delaying his API for years now because he’s continuously helping people
- there’s no other reason for the delay!

have any alternative ? (discordjs v13 btw)
i am not gonna ask why you're using intellij for javascript
hmm, docs seem to give a better alternative.
https://discord.js.org/#/docs/main/stable/class/MessageEmbed?scrollTo=setFooter
It's a habit. I also use it in Python.
thx
wait are they really getting rid of it
i swear at this point they should just make another library
i dont like most of their changes the old syntax was completely fine
i feel lost now when using the library because i try using something that was there for many years but oop they've removed it
oh they're only deprecating the icon parameter, was out of place anyways
point still stands tho
Tbh since more of those helper functions now require to pass an object as option, what does people actually prevent from writing the whole embed object themselves?
Less code anyways, looks cleaner on my opinion and you don’t have to import the helper function of the djs package
throwback to the time everything was actually in a single package
What discord expects as data with the API request will most likely never change
Still doesn’t change the fact what I said above
How can I disable Inspect element on a chrome extension using js?
so it's like this
instead of this
collector.on('collect', async (i) => {
let id = i.customId
switch (id) {
case 'english':
language = 'en'
row.components.find(id => id.customId === "german").setStyle('SECONDARY')
row.components.find(id => id.customId === "english").setStyle('PRIMARY')
i.deferUpdate()
break
case 'german':
language = 'de'
row.components.find(id => id.customId === "english").setStyle('SECONDARY')
row.components.find(id => id.customId === "german").setStyle('PRIMARY')
i.deferUpdate()
break
}
})
Why is none of the buttons style changing?
i think its because you are editing the local instance of that interaction, not actually submitting it to discord unless im wrong
you would have to edit that message with the new button styles
I forgot to edit the new message, I am lost
how to send ephemeral message in discordjs v12
you dont
npm i discord.js@latest
You should switch to detritus
Xcuse mme sir have you heard of Detritus by any chance?
what its detritus?
with absolutely nothing flawed
everything in djs is flawed
ever since v13
v13 = 
Not with Detritus though oh no, it comes with a client that is made for interactions
dark+
it's very difficult if i have to repeat my code from 0
i think eris is nice
no
but i am using d.js v13 lmao
eris bad
eris no support v9
i know
discord js v13 is a bit complicated but has a lot of features
a lot of useless stuff as well
i agree
not to mention it removed a good bit of what was useful
For example, it caches everything f*ck
caching isn't actually that bad what
you can only do so to slash commands iirc
temp banned from what
assessing api
Which API
discord api
hey guys my bot keep on getting temp ban for even after using sleep fucntion of 2 sec before sending any message help please
I dont think sending a message every 2s is good idea
I suggest you read #development message.
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
step 1: write module to track current ws ping and an average,
step 2: use statsd to send that infomation to netdata
step 3: view the information in realtime on web dashboard or use bot command to poll netdata for info over time, then send image containing graph of the data.
now... how to profit? 😂
const filter = (reaction, user) => {
return reaction.emoji.name == ':heart:' && !user.bot;
}
var collector = msg.createReactionCollector({filter, maxUsers: 1, time: 10000});
collector.on('end', async collected => {
if(collected.size){
... // etc.
}
});
I have a problem this I changed discordjs version 12 to 13 and I looked docs and edited but this part not working. collected size always return 0
It's like the filter isn't working at all. and I tried to print something with console log into the filter, it still didn't write.
let site = 0;
let embed = new Discord.MessageEmbed()
.setTitle('Setup')
.setDescription('Site: ' + site + '\nLanguage:\nTheme:')
let row = new MessageActionRow().addComponents(btns.getBtn('next'))
let reply = await inter.reply({ embeds: [embed], components: [row], fetchReply: true })
const filter = (filter) => { if (inter.user.id === filter.user.id) return true }
let collector = reply.createMessageComponentCollector({
filter,
})
const rowChanger = (site) => {
switch (site) {
case 0:
return
case 1:
row = row.addComponents(btns.getBtn('german'), btns.getBtn('english'), btns.getBtn('next'))
return row
case 2:
return row = row.addComponents(btns.getBtn('next'))
}
}
collector.on('collect', async (i) => {
i.deferUpdate()
switch (i.customId) {
case 'next':
site++;
inter.editReply({ embeds: [embed], components: [rowChanger(site)] })
break
}
})
btns.getBtn is an exported function which returns buttons which works fine.
I get this error when pressing on the button with the custom id 'next'
let type = data.type;
^
TypeError: Cannot read property 'type' of undefined
Your issue is here: reaction.emoji.name == ':heart:'
Emojis won't have colons around them when sent through the API.
I tried but same
i think they recommend you to listen for buttons instead of reactions now
can also have buttons that show emoji's 🙂
Made a little mistake. You'd remove the colons for custom emojis, but since you're using a standard emoji, you'd use its raw unicode. So rather than ❤️ or :heart:, you'd use \❤️.
There's also buttons to consider, as Dekita said.
Is there a bypass around rate limiting?
Because I have 1100 people interested in a event, and it involves them all clicking buttons.
Can i make bot edit it's own message 1st on 5 sec and then 2nd one after 2 sec? with 2 normal interaction buttons? (queue time is tooooooo long i don't want want my bot got reject so asking)
no
Thought not.
there is btw no datain my code. I am using discordjs newest version
did i do something wrong , says TypeError: Topgg.api is not a constructor
Yes, you did something wrong.
and that is ?
If you read the docs https://topgg.js.org/classes/api
capital A , damn
it changed
last time when i was coding , it was small a
thenks btw
Is there a way to remove this after someone clicks a button?
Button's work but it always says "This interaction failed"
interaction.deferUpdate()
when i get node js, do i have it install nessacary updates
When you install Node.js, you install updates as you choose to.
You can stay on a vulnerable version as long as you want, but it's probably not the best thing to do
👏 In what language
im guessing typescript
Function
fuck this ts
🤔
yeah thank you
All you gotta do is capitalize the f
yeah
How can I see if my chrome extension get's uninstalled?
Cant
Chrome doesn't allow the detection of such a thing
Oh, some websites make it so when you install an extension it'll redirect you to a page like why did you uninstall it etc
You can only set a uninstall url
It does
uninstall URL, track the amount of users who view that page
oh okay
ty
Well yea you can track how many uninstall it
👍
but you can set a uninstallURL which can lead to a survey
okay
there ya go
okay
ty
npnp
let site = 0;
let embed = new Discord.MessageEmbed()
.setTitle('Setup')
.setDescription('Site: ' + site + '\nLanguage:\nTheme:')
let row = new MessageActionRow().addComponents(btns.getBtn('next'))
let reply = await inter.reply({ embeds: [embed], components: [row], fetchReply: true })
const filter = (filter) => { if (inter.user.id === filter.user.id) return true }
let collector = reply.createMessageComponentCollector({
filter,
})
const rowChanger = (site) => {
switch (site) {
case 0:
return
case 1:
row = row.addComponents(btns.getBtn('german'), btns.getBtn('english'), btns.getBtn('next'))
return row
case 2:
return row = row.addComponents(btns.getBtn('next'))
}
}
collector.on('collect', async (i) => {
i.deferUpdate()
switch (i.customId) {
case 'next':
site++;
inter.editReply({ embeds: [embed], components: [rowChanger(site)] })
break
}
})
btns.getBtn is an exported function which returns buttons which works fine.
I get this error when pressing on the button with the custom id 'next'
let type = data.type;
^
TypeError: Cannot read property 'type' of undefined
the code let type = data.type; isnt my hand written code. Must be in the discordjs libary
interface Something {
callback: () => string
}```for example
so i am using slash commands and incase a user skips a option i'd like to set a default one
is there a way i can do that
show the full error
let type = data.type;
^
TypeError: Cannot read property 'type' of undefined
at Function.create (C:\Users\Flo\Documents\GitHub\noah-bot\bot\node_modules\discord.js\src\structures\BaseMessageComponent.js:62:21)
at C:\Users\Flo\Documents\GitHub\noah-bot\bot\node_modules\discord.js\src\structures\MessageActionRow.js:58:85
at Array.map (<anonymous>)
at MessageActionRow.addComponents (C:\Users\Flo\Documents\GitHub\noah-bot\bot\node_modules\discord.js\src\structures\MessageActionRow.js:58:55)
at rowChanger (C:\Users\Flo\Documents\GitHub\noah-bot\bot\slashCommands\other\setup.js:23:21)
at InteractionCollector.<anonymous> (C:\Users\Flo\Documents\GitHub\noah-bot\bot\slashCommands\other\setup.js:34:29)
at InteractionCollector.emit (node:events:388:22)
at InteractionCollector.handleCollect (C:\Users\Flo\Documents\GitHub\noah-bot\bot\node_modules\discord.js\src\structures\interfaces\Collector.js:108:12)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
so the problem is row.addComponents(btns.getBtn('german'), btns.getBtn('english'), btns.getBtn('next'))
first of all the function expects an array
so ([a, b, c])
not (a, b, c)
What's wrong is trying to set an image on a promise resolving to a message
doesn't make sense
You probably meant to use that on an embed
What
Did you not read the error...?
if (i.customId === 'primary') {
const embed = new MessageEmbed();
await i.message.delete();
interaction.channel.send({ embeds: [embed
.setTitle(title || "New Message")
.setColor(255)
.setThumbnail(thumbnail || interaction.guild.iconURL())
.setDescription(`${cool.content}`)] })
.setImage(image || interaction.guild.iconURL())
thumbnail works just fine
and so does title
i collect all of them the same way
You can’t call .setImage on a message promise as klay said
you're calling sendImage after sending it instead of on the embed
^^
oh
Also just don’t construct embeds like that, if you’re going to chain after making a new embed then do it all at once and not inside of your reply function
oh fuck
i am stupid
didn't even see
the beers got me like that
can u get a image from a message
like only the image
discord.js
look in discord.js's documentation for message attachments
message.attachments should be a Collection<string, Attachment> iirc
Or something similar
Yeah
let number;
const maka = Math.floor(Math.random() * 101);
if(maka >= 50){
number = answer3
}else{
number = Math.floor(Math.random() * 101);
}
let g = await setInterval(() => {
console.log(number)
console.log("Message initialized and logged:");
const messagelinks = fs.readFileSync('./messages.txt', 'utf8');
const links = messagelinks.split('\n');
const link = links[Math.floor(Math.random() * links.length)];
console.log(link)
ClearInterval(g)
}, number * 1000);
```does anyone know how i can let the timer run again with a new number variable, after the clearinterval?
because now it does the first part (defining the number), but i need a way to keep on chancing those number variables and starting the timer again
create another interval
also, intervals are not promises
you dont need to await them
no this code was a pure tumor
i used a recursive function
so i am running the function and before it ends stopping it with a timeout
could’ve been worse
You could’ve used goto 
Goto is a thing in js right?
Never mind it’s not
it is I think just not widely used
like labels?
goto doesnt exist but labels do, although they only have a single use case
If you think about it functions are kinda like labeled goto statements
👀 make sure to make your storage buckets private.
Someone figured out one of my bucket read URL, and loaded 400gb by refreshing a single image over and over for the past month.
only a few dollars in fees, but still
oh christ
guess what I did today 
what 
dealt with that 
how
set it to private, and added authentication to all the webserver fetches.
dnd 😔 no pings
i mean i didnt get it
also you might know a solution for this, what is the best way to make a cdn faster
i'm using a 512gb vps that costs £3.50 a month, is it worth going lower storage and getting one with SSD storage?
imo, your mass storage and "serving" storage should be separate servers.
hdd for storing everything, ssd/ram for serving to the user.
However, if images show in a few seconds hdd alone is probably enough.
they do load pretty quick atm
and for 2k+ images its only 1.7gb
the reason I use a storage VPS is because its faster uploading
If you want something cheaper, backblaze is a great option.
would handle all your storage needs for free currently.
$5 per tb of data
I'm looking at scaleway
charged based on how much you use, etc
👀 looks about the same price
more free data, so seems like a good option.
not seeing any egress fees listed, which is odd
slightly higher egress fees, but its 75gb free, so likely cheaper to use at the moment.
the nice thing is they are both s3 compatible, so you can swap quite easily down the line.
and free data transfers in on both, so realistically free to move platforms.
Im forever against scaleway
Oo
Had nothing but issues from them
Why
We've had about 4 servers experience almost total failure and had to deal with their support responding over days only to be told "yeah not much we can do"
👀 that's spooky
Wasnt even with the same clients either. 1 server issue was on a completely unrelated project which basically causes the entire database node to die and be unrecoverable. Had to be loaded from snapshot.
the other 3 Were another client
so yeah, never going near them again
It wouldn't be as bad if their support wasn't so slow and then almost just seemed like they didnt care
its cheaper for them to lose a client than to find and fix the issue i guess
i wonder how many big companies operate on the same principle
every one of them
I can guarantee you that
except for maybe the san francisco startup with 3 three employees
Kind of why I like galaxygate so much.
Every issue I've had has been fixed so fast and communicated so well.
Small enough to offer customer service, but big enough to fix your issues quickly still
(Small enough to have been waiting for storage servers for 2 years though kek)
Yee been using galaxygate too
For my REST API, I want certain endpoints to accept entity IDs or maps representing said entity. For example, POST /user's body may be represented like so:
{
"name": "Klay", // User name
"favorites": [1, 2, 3] // Entity IDs (must already exist)
}
{
"name": "Klay", // User name
"favorites": [{ "name": "Book 1" }] // Entity maps (will be created)
}
Is there a specific name for this pattern? I know it involves references.
Foreign keys?
Support was ok, but dashboard has some questionable things, like the fact you could sign up with an invalid email and pay for the servers etc... all without verifying your email.
It only asks to verify after you've paid teh fucker and then find yourself mildly locked out
not sure if they fixed that issue or not since I tried them last
👀 thats strange
kinda why i stay with Brixly for webhosting
literally every ticket i open is replied to within 5 mins
no matter what time of the day
C:\Users\ruben\Desktop\BOT-100-CMDS-main\node_modules\discord.js\src\rest\RequestHandler.js:298
throw new DiscordAPIError(data, res.status, request);
^
DiscordAPIError: Invalid Form Body
34: Application command names are unique
at RequestHandler.execute (C:\Users\ruben\Desktop\BOT-100-CMDS-main\node_modules\discord.js\src\rest\RequestHandler.js:298:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (C:\Users\ruben\Desktop\BOT-100-CMDS-main\node_modules\discord.js\src\rest\RequestHandler.js:50:14)
at async ApplicationCommandManager.set (C:\Users\ruben\Desktop\BOT-100-CMDS-main\node_modules\discord.js\src\managers\ApplicationCommandManager.js:146:18)
at async Client.<anonymous> (C:\Users\ruben\Desktop\BOT-100-CMDS-main\handler\index.js:45:9) {
method: 'put',
path: '/applications/921924043043643444/commands',
code: 50035,
httpStatus: 400,
requestData: {
json: [
{
name: 'apagar',
description: 'Apaga um canal',
type: 1,
options: undefined,
default_permission: undefined
},
Someone know what is this error?
check if you have a duplicate command name
Specifically command "apagar"
What is the difference of run and execute?
depends
in speed is any difference?
depends 👀
in what way are you talking about?
run and execute are extremely popular words in programming
and can mean hundreds of things
for execute/run commands
like as in the function name?
yes
so is the same
function adinaipodnmsoakdDSAKMNdsADkskamdpAD() {}
would work too ^_^
its just a name
a function in a handler is still the same thing
like module.exports = {
async execute () { }
and
run: async () => { }
is that the same?
yep
well no, but the name part is
arrow functions have some slight differences, but not performance wise
so the performance is the same no matter what?
its just a name, correct.
when running the name isnt even used(its converted into machine code! names are not used there)
its just for you to be able to read it.
that's why i used sleep but didn't work
Is it possible to pass an array of role IDs to roles.remove() with a single invalid roleID, or will the entire call fail and no roles be removed?
member.roles.remove(['abc', '(valid ID)', '(valid ID)', 'etc'])```
or it has a function that takes user input and responds with Where (userInput)? 😛
👀 I would expect it to error.
Do you not cache roles? should be able to check if they are all valid quite quickly
I would expect them to be cached already but man I would love for it to silently error on one invalid one instead lol
use html and css
- Make a webpage
- Embed the page with iframe
Is there a function to set components instead of adding components?
row.addComponents([buttons])
I dont want to add components to the current components I want to set new components to a row.
Thanks in advance
discord.js
why is that folder named BOT-100-CMDS-main
please not another multi purpose bot with discord.js 🙏
What is the difference
tf
I dont get what you want to do here
Can you elaborate more?
nvm there is a function setComponents but I dont have that version because I wasnt in the newest version of djs. I need to update nodejs now
k
"k" 😐
mutate the entire row instead of pushing more buttons to it
Eh
Ig
client.on('messageReactionAdd', async (reaction, user) => {
if(reaction.emoji.name === "✅" && user.id === args1.id) {
if (!database[args1.id]) database[args1.id] = {
balance: [50]
};
fs.writeFile("./userdatabase.json", JSON.stringify(database), (err) => {
if (err) console.log(err)
});
if(Number(database[args1.id].balance) < 5 ){
message.channel.send(`**The balance of ${args1} is lower than ``5``:small_blue_diamond: ! Therefore he cannot accept the duel!**`)
return 0;
}```args1 is not a function?
how would i possibly fix this
as all i am doing is literally pinging the user
args1 is a message.mentions.members.first()
just use message.author.id
and json is not a database
that isn't the issue tho
well yeah i already now
it's temporary
oh i misread
can you share the whole code
because like "message"? 
share what args1 actually is
@rustic nova cringe.dev looking very cringe
thinking about yeeting my website/remaking it entirely anyways
I'LL MAKE IT
for how much
0$
nah
well my nitro's expiring on 15th
crypto or paypal
can do both
crypto then
Will think about it 
you can always just fork my own site

ok time to do history assignment
then i'll decide what framework to use to clone your abysmal site
guys but how do I send a message in a random channel on the servers where my bot is?
In the v12 discord.js
Dont
Problem solved

it is bad to send in random channels
It's the world's most annoying thing for a bot to do
Not only ignoring the fact that Discord dislike you doing it in the first place
Why isn't it okay?
It's often unsolicited.
Of course, if you tell us "why" you want to send a message in a random channel, that may help.
To make announcements of the bot
Oml no
Just have an announcement channel in your support server people can subscribe to themselves
See? Unsolicited.
I don't want to invite your bot and unexpectedly get messages about that 8ball command you added.
You should make it solicited.
e.g. using announcement channels or allowing the user to set the channel before sending any messages
The better alternative being the former.
Since it's standardized.
Ok I'll do as you say
yes
I am shocked you managed to get cringe.dev
I thought any domain with cringe in it would be expensive asf
Am surprised it was free
wait what
where?
I mean free in the sense of not used yet
Oh
ah
How much did it cost?
dude u just shocked me for a momment
.dev domains shouldnt be extraordinarily expensive
they are like 12-15 euro
Renewal is 12 euros
dang
all the good domains using cringe are expensive
can't imagine how much for cringe.com
registered in 1995
that hurt bro :<
my website...
I dont think it was actually registered in 1995
zyx looks cooler anyway
xyz is what most websites for bots use now adays
at one point I think google blocked xyz sites from showing up
unless they are like dyno and can pay 60+ for a .gg
nah, i don't think so
I'd rather spend 4-5 extra on .com than .xyz
same
xyz is good for people who aren't serious
even googlers don't like xyz
lmaoo
fuk
think about the naive user who's going to visit your site
they're probably going to think twice about clicking on your site if it has .xyz in it
given the scams they've probably seen with it
Time to make a fortune with cringe.dev
but not take the same consideration into a .com
the tld usually doesn't make one site safer than the other
but the kind of sites you view usually fall into some domain camps
that is what I mean
what is tld
top level domain
ah
yea
the point is, if you care about having a shiny site, you should consider more popular, reputable domains like .com, .org, .dev, etc.
does .com have virus
here comes woo
I already paid for it
time to woo us woo
👀
paying for more than a year imo is a bad idea unless you know you're going to keep that project going
it is my profile website
yeah
I would think the lower visit count of xyz matters less when paired with a bot.
If its for just a site it probably is more of an issue.
mee6.xyz
who said it was safe
but it takes ur money for half the features of the bot
mee6 itself is a virus that spreads to other servers
😩
you should look at what they were doing with auctions
mee6 might as well be a well played out scam with how much money it be making
yeah bro we use your money to maintain mee6 for years to come but we'll gladly dash out 3k on having a top spot
Lmao
they paid a lot for ads
They dont even need the top spot anymore which is why I think they stopped
mee6 is popular enough now that it gains servers from the servers its already in
Imagine how much money they make from the 16m servers
where is that at tf
and they said bots can't be profitable
icic
super premium ultra pro max
their premium lifetime plan is 90$
12$ a month for premium
no
So it is enticing to buy lifetime if you have the money
yea
thats their membership feature to monitize servers
mee6 wont publicly show how much they are making
yeah
But its easy to guess when they used to bid 10k for top spot
imagine a legend copy all feature that mee6 have and give to discord comunity for free
30k ish a week
maybe even ore lmfao
3 spots, $10k each, one week
discord is kinda sweat spot to earn money, if you how to
for example the ads in top.gg
for bids
Not hard at all, but it falls under coca cola case
coca cola case?
what is that
is that some copyright case that happened or smth
i think it is about branding
like ppl prefare to use something familiar with them
instead something new
Like, anyone could recreate coca cola
But would it be coca cola?
lol
like u drink pepsi and cola when ur eyes are closed, it will taste the same
but with eyes open
cola will be better
Not even joking, it's not hard at all, but the name "coca cola" is what makes you auto lose against it
pepsi is better by far
As long as the name is different it doesnt matter though
It does, cuz you won't be able to maintain the cost
if one day cola change the name to something else and sell it, ig nobody gonna buy it
hm?
Coca can profit cuz their branding is widespread and very famous
So they can use expensive machinery and ingredients and still profit heavily
and because it can't stop trying to make its name sound cool ("the coca cola company")
Yours would taste exactly the same, but you'd lack the "famous" part, so your brand would slowly die
yeah, so if u make a moderation bot, there is no way to beat those giant rich ass bot (dyno, mee6 bla bla)
know your target market
So you'd not be able to maintain the hardware and ads
I mean as long as you can make yours appeal more to the people you could probably do so
Negative profit is still negative
A big software should be able to pay for itself
yea, if u spend money but it won't return any profit and u will die
yo haku you use java right?
Ye
i can't imagine how mee6 are risking their life to spend those money for ads
What do you even make most of the time?
Cuz they probably have a pool of money earned by mee6
I mean at the first time
when they just created it
Oh, they didn't
they werent spending a lot when htey first started
oh
back when mee6 came about not many bots were like mee6
yea
When the market was tiny
So mouth spread took em far
lol
the market was almost non-existent
Currently, new cards for my TCG
what is that
And occasional bug fixing
Trading card game
ah
Kinda like yugioh or hearthstone
You are making your own trading card game?
Already did abt a year ago
But kinda sad, cause those bots aren't impressing the interviewers
But since all cards have to be manually done...yeah it takes a lot of time
oliy is a super rare card :^)
You don't need to win against mee6, you just need to own your place in the market
is the tcg available to other people to mess with
and it is hard
Well, it's a discord bot
But in portuguese
Didn't have enough wills to i18n it yet
Just get a bunch of volunteer translators
ez
or google translate the fuck out of shit
The hard part is that I still need to collect the strings into a file
Most of it is still hardcoded
oof
Yeah, the pain
One of the reasons why if ima implement localization ima lay the foundation down closer to the beginning
So it wont be nearly as annoying later on when I start translating multiple languages
I didn't know early enough about i18n, when I started it was already a big ball
lol
If only I knew java had a native way to i18n
damn
I18n is basically a big file of strings in a property format
Then u clone that file and translate to another lang
I remember u when u found out everything is a string there
But well, since java has positional placeholders you can just format it
The hardest part would be making that file
imo positional placeholders isn't good enough
it helps with variables but not when those variables need edgecases as well
like how many items are in a list: no items, 1 item, or N items
functions are cool for that
or the localizer will get fancy and do that for you
or you'll make a localized key for each item
Oh for that I make custom collectors
Inside those collectors you can also i18n captions
example pls
Like, make a file of singular/plural values
And use those like u mentioned above
Unless you also allow custom values, but then you can always use "s" or custom regex to detect whether s is a valid plurality
English has regex for that iirc
yeah but that's english-specific
sounds interesting
I just think functions would be simpler to work with
the most I've done with localization is with an Xcode project
but it didn't have functions and instead handled edge cases for you
How can I get the text something like this
fetch a message and access it's .content?
the hyperlink in message content
well it's markdown so you'd need to parse the message content and extract the link
you probably have a library for that
No No No.... my friend I want my bot to be able to send a message with hyperlink
in message body content
Ah, you can only do that with webhooks.
Oh that's unfortunate
But it's regular markdown: [Google Search](https://google.com/)
Yeah I understand that. Still thanks for the info
Didn't knew webhooks are capable of hyperlinks in message body content
I dont think so
it is only for the embed
as I remembered
Webhooks can use links in the content and embeds
Regular bots can only use it in the embed
Oh that's intresting.
How can I get a list of all key permissions a user has like dyno does?
https://cdn.discordapp.com/attachments/874431116533178459/927265761251196938/unknown.png
discordjs
depends on your library
a obvious question but I'll ask it anyways. Can I make my bot send the invite of all the servers he's in? Or individually by name
Why
You can, but it's likely unsolicited.
oh ok
Most likely for backdoor functionality.
just had curiosity, if I need it someday
ok
If you need an invite to a server, you should ask a member (excluding your bot).
ok
Not only a member, someone from the server's staff

