#development
1 messages · Page 149 of 1
Only if you want to do something other than just calling super, or if you want to call it with specific parameters
ah I see
but what does voltrex not know ;-;
Well hes a maintainer of the v8 stuff I wouldn't be surprised if he knew something so trivial
the feeling of a warm embrace
unable to use the 4k skull
One message removed from a suspended account.
One message removed from a suspended account.
thats even worse 😭 😭
how would a single elimination tournament work that allows ties? should a tie count as half a loss or nothing?
app.post("/dblwebhook", webhook.listener(vote => {
console.log("vote received")
// ...
}), (_req, res) => {
res.status(200).json({ message: "Vote received" })
})
```I needed to test some things on the dev bot before releasing it in the main bot, but the dev bot is private because it's for testing purpose of new features only and I can't public it to top.gg for testing the vote updates system. is there some solution for it? what could I do?
the dev bot is locally on, so I tried putting the localhost url in the webhook url of the main and used send test, but it didn't work
If you don't do port forwarding then localhost won't work for you
rematch
<script type = "module" src = "script.js"></script>
<div class = "login_box">
<button class ="login" onclick = "getDetails()">
Login
</button>
</div>
where the function getDetails is created. Only problem is, is that the getData function is not recognized?
what does your script look like?
a regular js script with a function getDetails(), and an import at te top.
import {date} from "./data" assert { type : 'json'}
function getDetails() {
let passwordValue = document.getElementsByClassName("password_input")[0].value;
let usernameValue = document.getElementsByClassName("username_input")[0].value;
if(passwordValue == "test" && usernameValue == "123"){
alert("You have successfully logged in! Welcome back to the dashboard.");
window.location.href = "loader.html";
}else {
alert("The entered password and or username are incorrect. Please try again.");
}
}
i've watched yt tutorials, used chatgpt, no one had the right answer.
are you sure your script is loading properly? scripts marked with module are a lot more picky and restrictive when being loaded
3login.html:29 Uncaught ReferenceError: getDetails is not defined
at HTMLButtonElement.onclick (login.html:29:61)
it's not loading at all as it is throwing me an undefined
maybe onclick doesnt work with modules? dont know modules are still reasonably new
can you try instead attaching a click event to the button from the script?
something like:
document.querySelector(".login").addEventListener("click", () => {
console.log("click!");
});
but that wouldn't matter as i still would have to call the function in listener.
it would still be undefined
well what I am thinking is that the onclick handler for some reason cannot see your getDetails functions because of some reason, so you should try to add a click event as i said above with an example and try call the function from there, or just log some test string
to rule out other possibilities
i know why it is not defined, it's because i am importing my script file as a module type rather than a js file.
But i am unsure on how to do it otherwise.
Why don't you take a look at this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
They provide examples that may be helpful.
Specifically the section about exporting.
How to make my bot read all the messages in replit's console and type all the things in the specified channel in discord using python code
?
sounds sus

even more sus
There's plenty of tutorials on how to get started with discord bots. Such general questions like that would require us to write the code base for you. Once you've gotten started and have a more specific problem you can come back.
Thats ur existence
you cannot read the console, the console is the output, once it goes there is gone from the bot's memory
what you have to do is find where in the code is the bot outputting the things to the console, and make it output to discord as well
my next moves
One message removed from a suspended account.

Oki thanku
find the handle of the console output and read the memory 🧌
why is postgres so fast
Im doing the most unholy queries imaginable with string includes, 2 deep relational checks and it just doesnt care
why or how?
probably more of a how
Sql starts to fail at scale. It works well until it doesn't. Then you need to move to nosql
huh?
should all the other players in the tournament wait until there is a winner, or should the rematch happen next round? Making all the other players wait would be annoying for them, but moving them to the next round basically means both teams won
sql does anything but fail at scale
not much u can do, either that or it'll be very hard to find a winner
a thing you CAN do, tho, is use a score-based tournament
this is not exactly true
then u can solve the ties in a final match, as there'll be more than 1 winner
so instead of an elimination based tournament it would be score based and it would end after X amount of matches player or something like that?
i saw it in a youtube video. it must be true
the player gets eliminated if they lose
if it's a tie, both players advance until they lose
i was going to let it be configurable. so it coule be single or double elimination
or triple
if they reach the finals, make them match against eachother until 1 lasts
then either they dont know what they are talking about, or they are talking about a specific situation or specific data model
there are many ways to scale sql horizontally
full sql or partiql?
full sql
lmao
thats specifically mysql, not sql in general
also depends which engine
sql has many different engines
also you can partition sql the same way you can nosql
at least sql lets you do it the right way
doesn't soccer change the rules for tournaments? like they cant tie and are required to do kickoff things
i need to see how they do it in soccer and chess
this could be helpful
all their methods for tie breaking are very bad
ties are quite hard to deal with
maybe i shouldn't support ties. if there are ties the discord server can figure out how to handle it
huh
in my experience nosql was miles slower at everything
can sql handle this
Amazon DynamoDB reliably handled 105.2 million requests/second across trillions of API calls with single-digit millisecond performance.
its not really about the query language but about the algorithms and technology behind the database
depends on the setup, as with any other database
thats stats for amazon hosted one, which is massively scaled with thousands of instances
that's the one i use
for free
my experience was based off selfhosted mongodb and selfhosted postgres
because I despise the cloud
try achieving that with a self hosted version
on your own vm
proprietary :c
i will start building my botnet for this
what
i only need around a billion machines to test the load
ah yes ok
i dont have a vm
imagine using aws or gcloud 
i switched from firebase to aws
firebases serverless is too slow
install it on your pc and run it offline
and try querying
i'm building a machine in a couple days
it's pretty quick. i run it in a docker container
want me to run some perf tests?
I need my sweet db ping
100 million per second quick?
Everybody is talking about Big Data and about processing large amounts of data in real time or close to real time. However, to process a lot of data there is no need for commercial software or for some NoSQL stuff. PostgreSQL can do exactly what you need and process A LOT of data in real time. During our tests we have seen that crunching 1 billi...
it's a trade off for stability at scale
i can't even test that
or can i?
once the data grows things like joins go slower and slower
not really
joins dont matter much if ur using primary keys or at least indexed (also unique) columns
yeah, those are the two main features used in nosql
nosql doesn't even support the idea of a join
it doesnt support relations either does it?
it does "support"
note the quotations
but then ur defeating the point of using nosql
tf do u mean u shouldn't
if you want to use class use something like java
oop is terrible use procedural!
???
ah yes, mb, lemme just hook some fuckin java into the browser
class is perfectly valid if you're working with oop in js
applets ftw!
it's also valid to never use class with oop
One message removed from a suspended account.
that'd be just abusing how js allows creating anonymous objects
what is nosql for then?
we could still technically implement java applets back into browsers lmao
port the jvm into webassembly and execute it 💀
literally never had a project that didnt use some kind of relations
One message removed from a suspended account.
imagine ur using a Map (json in js), basically that
nosql is, in simple terms, a queriable map
redis is super expensive
nah thats lmdb
redis is a full server
its free open source, you can self host
redis has an event subscribe thingy
the memory is expensive
for that you get speed
it supports larger than ram datasets
but its not meant for it, its meant for use as a cache, so yeah
One message removed from a suspended account.
this is also not true
ben I think you should stick to your null vs undefined debate
that has been settled
really?
by judge Ben
lmao
me when uninitiated pointer
i would make that one line
const {application_id, token, guild_id, member: {user: {id: user_id}}, data} = event;
🫠
idk, but having the left bigger than the right gives me some shivers
i'm using the guild scheduled events feature to schedule tournaments. if the tournament is a 2v2 should i only allow one person to register for the team or should i require both of them to register and register as a team?
i think only allowing one person to register for the team will be a better UX
and much easier to program
Clyde is a real user that you can message lmao
@prisma lichen
{
id: '1081004946872352958',
username: 'clyde',
avatar: '6170487d32fdfe9f988720ad80e6ab8c',
discriminator: '0000',
public_flags: 0,
flags: 0,
bot: true,
banner: null,
accent_color: null,
global_name: 'Clyde',
avatar_decoration: null,
display_name: 'Clyde',
banner_color: null
}
@prisma lichen Are you here as well?
Experiment not enabled be like
-ui 1081004946872352958
Something went wrong when trying to ban this member
And there goes clyde
ye fuck clyde
Shit bot ikr
ye like Ruri

lol
First time for me making my site I keep seeeing random GET requests such as GET /autodiscover/autodiscover.json?@zdi/Powershell 404 0.366 ms - 169
Should I be concerned
One message removed from a suspended account.
probably something else or could be bots scraping the web looking for websites with vulnerabilities
had that happen to me a few times
One message removed from a suspended account.
No VPS
tried to see if my website had a php version vulnerable to the .php file upload vulnerability and if they could access the directory tree for the current directory lol
Can't really prevent it
I mean, u can put a robots file, but people will scrap the site as soon as it's online
Even when offline tbh
Some bots do check for vulnerabilities. Some also check for a /well-known/security.txt so that they can email you about vulnerabilities they find
Nobody has emailed me yet tho because I don't use wordpress and I don't use php.
XSRF tokens are also being used
I will find a vulnerability 😉
https://amanda.moe
good luck
I only use public key authentication. There is no password
gib private key file 😉
Damn. Got me there
ayo?
We commission the donut
blahaj
based mod banning clyde
Amogus
One message removed from a suspended account.
weeb behaviour
Debugging time 
Are you doing anything in response to them calling that command?
Show your code
hello
Hey 👋
Nvm
its work now

This may not solve your problem
A lot of people don't know that you have to respond to an interaction within 3 seconds unless you use .deferReply()
If you use some api or play with the database in the command, it is worth using it because not in every case you will be able to respond to the interaction in time
rule of thumb is, if you're not immediately replying or editing, defer it
Tbh I always defer no matter what. It’s in my handler. Is that a bad idea?
not really
but if something does fail, it'll just continuously show that thinking thing
unless you respond with something if something fails
Someone will wait 10 minutes just to see "interaction failed" 
oh yeah thats a thing too
just wrap the handler in a try-catch, with a reply if anything happens
btw @wheat mesa, doing a bot in what lang?
I want to ask if if our bot is verified we can report people who try to copy our bot? To discord support.
My bot is still 80 servers thanks to top.gg, and I'm top 1 on growtopia searches
if you're referring to situation between your bot and that other one, we dont handle that
nor im guessing would discord
unless they're using assets owned and copyrighted by you, then discord could interfere if that bot is verified
besides, copying in what sense? pretty much every feature was already done by at least a dozen of bots
someone slandered me for using their source when I made it myself, even though my bot is older than theirs. So can I report their bot to discord support if my bot is verified?
nope
he slandered me for copying all the features and when I replaced them with slash commands he still bullied me even though I made the source myself a long time ago.
just ignore them
Yes, I've tried to let it go because my bot was made by him first. But this is very anoying
block them
wouldn't be the first time someone got triggered when they found out their unique idea ain't really unique

do we have access to the private key that discord uses to sign messages that are sent to our bot's interaction url?
they do something like that
then im sure they dont
so it shouldn't be too dangerous to allow someone elses bot to point to your interaction url and be authorized.
unless you're using a different authorization token to respond to a interaction
then discord would notice
tbf, I feel like that could result in a funny bug
as long as the commands are registered correctly then it should work
no only the person that signs the message should ever have the private key, discord only gives you their public key so you can verify that they signed it
that should make it safer than if we have access.
in double elimination tournaments there is a winners bracket and losers bracket. in a triple elimination tournaments would there be 3 brackets? one for players with 0 losses, one for players with 1 loss and another for 2 losses?
No, why would we need it
you would only need it if you wanted to send a signed message to your interaction url
why on earth would you want to do that?
idk, maybe for automation tests or something
fairs
you could fairly easily create a seperate key for automation.
yeah
It's just an ed25519 curve iirc
just bypass it too
that's the other option
can I buy one of your nfts 
absolutely, there's a checkout link at https://valk.sh/nft
thanks!
ts
I’m not currently doing it because my idea got fucked by paywalls on stock information APIs
hi
relatable
wanted to like, make a grocery api that hooks up with a screen on a raspberry pi so I could keep an inventory of my fridge
turns out theres no grocery api at all for use
fucked my idea too, would've been good
even with a scanner next to the fridge I could scan the barcode of, thats what the essential part was
theres no API for these fuckin grocery barcodes
work at a supermarket lol
you get access to portals that have all stock and barcodes
might have found something
could've built up my own database
Use Barcode Lookup to search any UPC, EAN and ISBN code to find product information including images, pricing, reviews and places to purchase online.
just tried that
look up the pepsi can next to me lol https://www.barcodelookup.com/87170146
Barcode Lookup provides info on EAN 87170146 - Pepsi Pepsi Max 330Ml Can Pack 24 5752359.
$100 for 5k api calls 💀
too generic imo
Wanted stuff like the brand, type etc
for example, theres soups here in germany of any type and any brand, each is different
oof
I saw this one site that had a very nice looking and smooth flame like effects with different color that only showed when you move your mouse around.
Does anyone have a clue what effect it might be
youtube exists
If i am here it usually means i have done my research
cool shit like this
doesn't a barcode just have data stored in it?
Kind of like those mag strips in cards
and that number is associated with a item for example in groceries
it just is another form of the UPC
it makes it so you don't have to manually type the UPC in
yes
Honestly
go to your local grocer and scan items into a database
you might look like a weirdo but anything works

true true actually 
I mean theres nothing about me just manually adding the ones I buy and using that smaller dataset
but new items need to be added too
or as you buy things and you know you will frequently buy them
just scan it at home
yea
barcode numbers are pretty dope tho, they include a lot of data like country of origin, type of item, etc
like discord snowflakes
yes exactly
but theres no public dataset of these
from like, all countries
:((
at least no dataset free to use
I can help put it together tho it won't be useful for a german boy to have american products

yeah
idm taking some time out of my very busy day to help you I guess
this one looks alright no? https://www.ean-search.org/
paywalled again
it did successfully find the product I have here
ofc you'd have to get others to help
but the api being paywalled
dayum
I'd imagine a model like this:
- contribute a certain amount of barcodes
- get access to the api for free
- otherwise an acceptable api limit or buy for unlimited
for example this one, allows anyone to freely contribute with no cost, still requires you to pay for api 
9 bucks for 100 calls per month seems ridiculously expensive
It would also give me a chance to mess with a rasp pi
almost like their database is terribly unoptimized
its literally like
SELECT * FROM items where EAN13 = 12345
nothing else to it
this isnt resource-intensive at all
they probably dont even have indexes
jasondb
lol
nah
literally a .txt file
separated by spaces on each line
that explains it all
also a cool added feature
beep when barcode
Ooh barcode stuff. I wanted to do something like that to catalog magic cards irl
dafuq is that code
silly magic doesn't exist
its python
cmon tim get with the program
lmao
@rustic nova mind if I steal the idea of making a global UPC database?
no go ahead
Ima make it free to use
anyone can contribute to it as well :p
make an account on their website, download entire database, upload to your database, profit
ong
What kind of data should I store though 
obviously the UPC and product name
also how does one even make a barcode reader
tf does it even do
meh i'll figure it out
try scraping this https://www.upcindex.com/195058705646
results are embedded into their html, so its easy to scrape, plus they claim to have 600+ million products, twice as much as the other one
could test what kind of protection they have against scraping if any :^)
i'd rather not
I wouldn't feel right leeching off of others so ima just force ask people from around the world to submit to my database

https://www.briandorey.com/post/Raspberry-Pi-Zero-Handheld-Barcode-Scanner-Part-1 this should be helpful
nvm
I don't know enough about PCBs to even attempt this

You could probably 3d print a handle that just has a light and a camera on it
If you want a handheld thing
I dont think you can just use a camera no?
You can
Just needs a general amount of lighting I figured out
And a pretty good amount of focus/autofocusing
A camera capturing low quality won't work really
Yes ofc
Same
for now ima just focus on compiling a database of items you get from stores
@rustic nova I will make it a public database so if you wanna add items lmk, I will make a web ui for it at a later date to make it easier for people
Swag
Honestly I might store more than just the product name and manufacture
If its food items I will store the nutrition info as well
Should add a way to live-camera scan a barcode ngl
I will once I get the funds to build/buy something to test that
Heres my plan for data storage
- UPC (obviously)
- Manufacture Name
- Product Name
- Nutrition Info (calories, sodium, sugar, etc)
- Ingredients list
- Maybe even add in Allergen info, such as peanut free or gluten free
For anything non food, I will store similar data but might include other info
Fair
My original idea was two data tables but putting it all into one and just adding an edible field is probably the better idea so im not making 2 database calls
ima get started right away
Might as well make use of my contabo object storage as well and use that to store images
:p
what should I call this project 
scanny barcode product thingymabob the third 👍
Tyty
SCAM - Scan Code for Any Market
Why does that sound good if the name wasn't attatched to bad taste

Honestly fuck it why not
actually now that I thought about it for 2 more seconds I know why not
namecheap definitely wont sell me a domain
ESCAPE - Extended Scan Code for Any Product and Entity
SCAB - Scan Code For Any Barcode
makes no sense but I like where this is heading
TINABS - This Is Not A Barcode Scanner
Tbh, there's YABS, yet another barcode scanner
YABS sounds good
Yea not something im looking for sorry :C
YAGPDB - Yet Another General ProDuct thingymaBob
isn't that a bot name?
No it’s a barcode project name Frfr
yup
I don't know what you're talking about
Yet Another Startup Tech Company
fake news
dayum
#general message lol
what's this https://botlabs.gg/
idfk
They own yagpdb and several other bots
Aka bought them at some point or became partners
crazy that companies buy discord bots too
additional revenue
but it seems that their service is just to help with uptimes on bigger bots
could be
or yeah these are investors
so they dont buy the bots directly, but merely help them
seems like it, since there is an apply form
iirc requirement being, you need to state that in your bots about me that you're sponsored by them
invite only weeb content api
for images and shit
tried to apply before with a bot with like 5 servers 
nekos.life but sfw
yes
you should be familiar with it if you are a multipurpose bot developer 
/neko 
-declinebot Your bot uses nekos.life with content that is not suitable with discord, skill issue
@rustic nova bot alerta compress
ban

nope
they buy them

YAG and Piggy and Carl are all botlabs now
and they all advertise each other, are owned by botlabs and operate it all
and they use AWS 🤮
is there any benefit using postgres enums over varchars when im not querying by them?
- They enforce a specific set of values which can help to maintain data integrity and prevents invalid/unexpected values from being inserted into the column
- Enums can generally make the data more readable and self-explanatory, since you can give them meaningful names which can also help all developers working on the project
- Enums can be more efficient in terms of storage and performance compared to varchars, this is because PostgreSQL stores them as numeric identifiers so they take up less space and are faster to query
Though note that enums values can't be modified easily once they're defined, because adding or removing enum values can require altering the table structure
And since these enums are specific to PostgreSQL, it makes it less portable so if you ever have to move to other databases, it won't be easy
so except storage space there isnt really a drawback? (yes I know readability but I have a wrapper that handles that)
Well yes, and note the first point as well if you actually even need that
I dont really need that, If I actually use ints instead of varchars the storage space shouldnt be a problem either
hey, i have a question. I recently started html and css coding. I am not very good at it, and i haven't acquired a good taste of design yet lmao.
is this background ugly?
second, i rather instead of the gray wanted an image to span across the whole body height, but maintaining it's width;
this is my css:
body {
background: linear-gradient(
to right,
#5A5A5A 0%,
#5A5A5A 50%,
#F5F5DC 50%,
#F5F5DC 100%
);
margin: 20px;
}```
Then avoid using enums
alr
hey
ARG TOKEN=""
ENV TOKEN=$TOKEN
is this the proper way to handle env vars in dockerfiles?
build:
context: .
dockerfile: Dockerfile
args:
TOKEN: ${TOKEN}
because with this i can add env vars from a .env file in my docker compose but im not sure if this is the best (or considered the correct) way 
so maybe for a bit more context, im builing an image of my bot which needs the token to login
That's a great way of doing it, I don't know of a better way
Ok good to know that im on a good track thanks 
just export ^-^
You can't import an ES module using require(), you would have to either using import statements (which doesn't exist in CJS), or use dynamic import()s (which exists in both ESM and CJS)
Though you can make a hybrid package that can be imported in both CommonJS and ESM in their native ways
https://www.sensedeep.com/blog/posts/2021/how-to-create-single-source-npm-module.html
help pls
literally an extension that only benefits these people that go "using master for git is offensive"
ffs
uninstall ez fix
uninstall intellij, use vsc

bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbut it is a reference to dark parts of history 😢
im gonna git push master off the cliff
Does this sound right for how a 6 team triple elimination tournament would work?
The first round matches up teams randomly. there would be 3 matches this round
The second round matches up teams that won against each other and teams that lost against each other. 2 teams would sit out this round since there are 3 winners and 3 losers and a winner can’t play a loser unless there are no other matches available.
The third round matches up teams that haven’t lost against each other, teams that have lost one game against each other, and teams that have lost two games against each other.
At some point 3 teams will be eliminated and there will only be 3 teams left. Let’s say team0 has 0 losses, team1 has 1 loss and team2 has 2 losses. Team1 and team2 would be matched up until one of them is eliminated and team0 will get byes. Then the last two teams match off until one is left.
more options -> ignore
i found out what was doing it
i had a plugin
you can use "victorious" and "defeated"
good idea
What would cause Favicon not to show up it works mostly on my phone is a 14 pro max it works on my friends phone which he has an exact model I tried clearing cache twice but just fails to show up on safari I’m about to give up
It even shows up when you share the web page to someone … but not in the tab space
safari wanting to be "special"
thats your answer
safari occasionally differs on very crutial elements from chrome, firefox etc
typical safari problem
exactly
A lot of stuff that works on say firefox, chrome, etc won't work on safari
Promise {
<rejected> [Error: 54190000:error:0A000410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:c:\ws\deps\openssl\openssl\ssl\record\rec_layer_s3.c:1586:SSL alert number 40
] {
library: 'SSL routines',
reason: 'sslv3 alert handshake failure',
code: 'ERR_SSL_SSLV3_ALERT_HANDSHAKE_FAILURE'
}
}
Anyone know what could have caused this error. Didn't effect my bot for what it was doing at the time, kinda strange.
This come from?
I have 0 idea which is the thing.

I've coded this bot for over a year, first time seeing it.
Just listening to music and it posted in my error log channel
Well it seems to have initiated a connection but the server failed to return a response
No idea what that could be from
Likely
I dont use patreon anymore so Ill just yeet that.
Never seen that error occur with discord itself
nodejs has the goofiest openssl errors
When I was doing OpenSSL stuff I was so confused I just gave up and did a os fresh install
you fucked up so badly you had to reinstall windows?
i had a weird openssl issue too i could not solve it
i had to update ubuntu to fix it lmao
damn
model Item {
id Int @id @default(autoincrement())
UPC String
ProductName String
ProductDescription String
AveragePrice Int
Edible Boolean
NutritionFacts Json?
@@unique([UPC])
}
So I have a prisma model here, would it be best to make NutritionFacts its own Model detailing the data or is there any other way I can outline the kind of data NutrionFacts is?
Termux still work for hosting?
Termux is a android app right?
model Item {
Id Int @id @default(autoincrement())
UPC Int
ProductName String
ProductDescription String
AveragePrice Int
Edible Boolean
NutritionFacts NutritionFacts?
@@unique([UPC])
}
model NutritionFacts {
Ingrediants String
Servings Int @default(0)
ServingSize Int @default(0)
Sodium Int @default(0)
TotalSugars Int @default(0)
TotalFat Int @default(0)
Calories Int @default(0)
Protien Int @default(0)
Item Item @relation(fields: [ItemId], references: [Id])
ItemId Int
@@unique([ItemId])
}
Is this overboard? I feel like mapping it out like this might be too much and going too in depth
or is it in a case like this the more information available the better
for those who don't know what im doing im making a database of product information that can be looked up via barcode or putting the UPC numbers in directly
does any1 know how to fix this barbaric error
my terminal keeps closing it's annoying
Were you trying to run something?
might be a permission problem since its code 2 but also might be a missing file
instead of columns, use Id, Ingredient, Amount, where Ingredient is either an enum (if ur using postgres) or a value from a third lookup table
that way you can have a variable amount of ingredient per product, as some do stray from the usual, especially regarding vitamins
I have a question according to the terms the bot does not require administrator perms to run a command so does that mean that I cannot add administrator to the invite or the command
One message removed from a suspended account.
Alright thanks for help
One message removed from a suspended account.
Ok
Not quite sure I follow
pardon my diagram skills, been some time since I had to draw one
basically, each component is from a fixed components list from the third table (nutrition component)
with postgres u can use an enum, it's essentially the same thing
use diagrams.net
see the name of the file
Would this not be inefficient?
That’s essentially 3 tables no?
I’d have to call from all three
Quite the opposite
That's called a M-N relationship, it's very common when you have items that also have items not necessarily owned by a specific item
It's more scalable than a fat column (like a json), and much faster to query
The table count matters very little in sql, especially in very low table amounts
As long as ur doing an INNER JOIN on an indexed column (preferably the PK), the joining part will be O(1)
components[1].components[1].custom_id[COMPONENT_CUSTOM_ID_DUPLICATED]: Component custom id cannot be duplicated
Getting this error while trying to recreate my buttons for an embed. My custome Ids are different, which is why I'm a lil confused.
ButtonBuilder {
data: {
type: 2,
emoji: undefined,
custom_id: 'yNDYwMTgw',
style: 1,
label: '1'
}
}
ButtonBuilder {
data: {
type: 2,
emoji: undefined,
custom_id: '2NjM1OTA1',
style: 1,
label: '2'
}
}
ButtonBuilder {
data: {
type: 2,
emoji: undefined,
custom_id: '3NzY2OTkz',
style: 1,
label: '3'
}
}
ButtonBuilder {
data: {
type: 2,
emoji: undefined,
custom_id: '5MDMxODk4',
style: 1,
label: '4'
}
}
ButtonBuilder {
data: {
type: 2,
emoji: undefined,
custom_id: '1ODcyOTI3',
style: 1,
label: '5'
}
}
unless im blind and not noticing what I'm doing incorrectly.
let row = new ActionRowBuilder()
let row2 = new ActionRowBuilder()
let row3 = new ActionRowBuilder()
if(pages.length === 1) {
if(songs.length < 5) {
for(i=0;i<songs.length;i++) {
row.addComponents(buttonsList[i])
}
row.addComponents(buttonsList[12])
} else if(songs.length < 10 && songs.length >= 5) {
for(i=0;i<songs.length;i++) {
if(i < 5) {
row.addComponents(buttonsList[i])
} else if(i < 10 && i >= 5) {
row2.addComponents(buttonsList[i])
}
row2.addComponents(buttonsList[12])
}
}
} else {
for(i=0;i<buttonsList.length;i++) {
if(i < 5) {
row.addComponents(buttonsList[i])
} else if (i < 10 && i >= 5) {
row2.addComponents(buttonsList[i])
} else {
row3.addComponents(buttonsList[i])
}
}
}
This is the code it comes from. Probably ugly and IK. Just a personal bot for my discord.
that buttonsList[12] is inside the loop
so you're adding the button 12 multiple times
that would do it
im a dummy ty
that was meant to go outside the loop one } down. Its my
button
https://scs.twilightgamez.net/l0XO1.png yap that was it lol
no
I see
is it possible to check who's the server owner via a server id
If you have access to that server then yes, the guild object has something like ownerId if I remember correctly
and if you're using djs it just gives you the owner object if they are cached
So with this, Product would have a one to one relation with NutritionFacts and that in turn would have a one to one with NutritionComponent (which houses what exactly in your mind?)
One to many
what
The side with 3 strokes is the many side
The one with a vertical bar is the one side

A one to many relation here makes 0 sense
Note the arrows
yea I get that but a One to Many relation makes no sense in this case
One product can have many facts, one component can be in many products

So it's a many to many relationship
I've never seen a product with multiple nutrition facts
Not the whole table lmao, the individual rows
What exactly are you thinking the data will look like between those 3 tables maybe im just not getting it
Each row will be a single ingredient
👀
pogu db relation discussion
So NutritionComponenet is basically an ingrediant?
I blame you
you're the one who got me into this


nutritions facts sounds confusing
It is
could be that im not american, its called ingredients here in the eu
yup
Ingrediants is really a separate thing
Product
---------
id: 1
name: Potato
facts_id: 1
Nutri Facts
---------
id: 1
component: 1
amount: 100
---------
id: 1
component: 2
amount: 50
---------
id: 1
component: 3
amount: 1200
Component
--------
id: 1
name: Protein
--------
id: 2
name: Carbohydrates
--------
id: 3
name: Vitamin A
For example
I just couldn't be asked to make it something else
gotta remember to normalize your database
that just seems so pointless
what is the use in doing it this way
1 to many yeah
Also u get a common list of ingredients to be used in many products
a ingredient should not be limited to one product tho
It isn't
good good

Im trying to figure this out as I haven't really done any programming in months
so give my smol brain time to process
I get what you mean now
normalization 1 2 3 etc
Consider you have 1000 products
The list of ingredients is pretty much constant
All that changes is the concentration or presence of it
exactly
There will ofc be a lot of commonality in ingrediants amonst products
So the middle table is for holding the rows of the nutri table
My question is
How would I assign those ingredients to a new table if they already exist in the NutriComponent table
Wdym?
a relational table, consisting of foreign keys
Just foreign key to it

A foreign key is a reference to another table's id column
its fun to learn about relational databases right? 
What I mean is, each time someone adds a new product to the database, what would be the best way of linking any already existing ingrediants to the new product without re-adding it.
using that middleware-like relational table
I hate database management
I'll force hire you to do it instead /s
Simply set the component_id column
Wouldn't I have to know the component_id at all times to do that?
| ProductName | IngredientComponentID | ...
| Cheese | 1 |
| 1 | 1 |
| 1 | 2 |
...
| Milk | 1
if thats how I understand this issue for example
thanks discord for your shit formatting
SELECT p.name
, i.name
, f.amount
FROM product p
INNER JOIN nutri_facts f ON p.nutri_id = f.id
INNER JOIN ingredient i ON f.ingredient_id = i.id
no idea how prisma does it
though that makes sense
Yes ofc
run from relational dbs as long as you can
Does this make sense for how a tournament would work? Green and red indicate who won and (2/1) means 2 wins and 1 loss. Byes are people who sit out a round.
But you already have the component's at hand
All you do is assign the id to the fact row
Im even more confused now
How would I know the id of the ingredient beforehand, are you asking me to make a map of ingredient ids or smth?
Unless I am missing something here I don't logically see how I would be able to do it like that
You populate the table beforehand
Think about it as a list of all possible ingredients
Regardless of product
ok
would you have to check if each ingredient exists in the table first? and check for different spellings
I'll give u a more concrete example in a sec
since you dont start with the id
You do start with the id
so anyone adding a value to the DB would be choosing from the list of existing ingredients
not very dynamic
how exactly would it be more "dynamic"?
without having a shitton of redundant ingredients, that is
consider Potato potato POTATO Some round underground fruit idk
Honestly I was just going to let them enter the ingrediants for each product but that would indeed end up with too many repetitions
now u have 4 entries for the same thing
here, consider this table, it's a list of characters ok?
the PK is the first column
just store it in a nosql db. storing redundant stuff is encouraged with nosql
now, each user can collect many cards
I understand what ya mean now
lemme finish it
I can just make a drop down of ingrediants and those chosen will be mapped to a comp id no?
ight sorry go ahead
Hello
so it's what your Nutritional Facts would be, a row of product x ingredient
Hi
and this is the table for general collection data
like storage capacity, etc, stuff not directly related to the cards
it links to kawaipon_uid in the previous table
that way many users can have many copies of the same card
without linking a character, but the collected card to a specific user
yes, this is how you'd optimally do it
why not store the stach capacity offset only if it exists?
?
everyone has a stash capacity of 250 by default. if it's more or less store that offset
otherwise assume it's 250
it has no advantage over what I did
an INT column will use 32 bits regardless of the current value
also makes querying easier
yeah, splitting it into tables would be more querying
i'm guessing you need that stash capacity often
splitting what? the capacity?
like, there's literally no reason to put it in another table
you could remove the stash capacity column
if that table is already the one supposed to hold general info
users can purchase more capacity
you could have another table for stash capacity offset keyed off user id. only put a row in for the user if they have an offset
see what I said earlier
remove the stach capacity row in the general table
that table is supposed to hold general info regarding that user's collection, not putting them there would make the whole table unnecessary
at some point you'd split it up right? or keep adding columns?
like if each user could have 1000s of different stash capacities
ok, imagine you didn't have breakfast this morning
...?
but can a collection have multiple users 😳
you're making no sense, why would I create many tables for info regarding a single user?
that sounds like something a nosql user would do 
Hi
I have a question, when the bot is being reviewed what perms does it have
The perms on the invite link you sent
I have a problem when my bot was being reviewed the bot gave an error saying it doesn't have enough perms to send an attachment in guildCreate event while the invite link had administrator on it, making my bot to be declined
The bot isn’t allowed to have administrator perms on it for any reason that’s how my last one got denied
But when I asked they said that the bot can have administrator on the invite but it can not be required for a command
My bot was denied because the commands were not working because of the error
When adding a bot, you can not give the administrator perms to the bot. You have to be sure that your bot works without it because not everyone wants to add bots with such permissions
Giving every bot an admin is a very ill-advised habit
The bot can work without administrator but the error comes with attach files perms
I asked the reviewer and he said that the bot are being added with perms=0 for reviewing
Did your bot then send a message to the user that the bot doesn't have permission to send files?
I don't quite understand what your bot would send when adding it to the server
It just send an embed with an image attachment
Then make sure your bot has permission to send files
It has the permissions
Yes
I had to look through my 156 commands and see what one had admin only on it
The fact that you give it such permissions in the link does not mean that it will always be added with such permissions
I tried without administration at first but it didn't work when reviewing that's why I added administrator
Is it bad my bot has 140k+ members between 46 servers
Giving it admin permission won't fix anything if eventually this permission is not granted and this can happen in a very large number of cases
You need to work on the bot a bit more
they invite it without any permission by default
when commands that require permissions fail, your bot has to explain why it failed and ask the user to give it the necessary permissions, and only those, not any excessive permission
in other words, only require the permission only when you do an action that requires it
your bot was declined because your commands failed without any explanation, you are supposed to catch those errors and provide an explanation
for example if the command fails, your bot has to respond saying that it failed and why, instead of not responding anything
Alright thanks
Hello, I am trying to post my server count to top.gg using clustering (discord-hybrid-sharding) and Discord.JS. The top.gg AutoPoster doesn't work as the manager needs to be either a Discord Client or a ShardingManager, whereas the cluster library I'm using has a "ClusteringManager" which does not sub-class the ShardingManager. Any ideas how I could get around this?
you can always do manual posting
how would you recommend I do that?
from your manager file, use broadcastEval to get shard and guild information from all clusters
then make a post request to the top.gg api
thanks 👍
im using pycord
How would i make a @bot.event whenever someone votes on my bot, and it returns the users ID
with the topgg sdk
A simple API wrapper for top.gg written in Python. Contribute to top-gg/python-sdk development by creating an account on GitHub.
Can I use canva or another library to add 6 gifs into one, bigger gif?
you mean append gif 2's frames to gif 1 for example?
tiled gifs?
Yeah
Good eve
What would I do
this channel is for asking questions regarding development
Thank ok
Is it possible?
you can use gifsicle
imagemagick could work too
although I'm not really familliar with the usage of those two but there's definitely a way
Yeah guess I’ll look into it
if you want JS only solution it would look janky and extremely slow
But the gifs are from an api
this is for imagemagick for example
And how would I use imagemagick with javascript?
there are wrappers
https://www.npmjs.com/package/gm is a good one
works for graphicsmagick and imagemagick
Ah alr
is there another way to shutdown a docker container if one of its services exits? im currently using docker compose up with the --abort-on-container-exit flag but is there maybe a config setting for the docker-compose.yml?
because i have a db service and bot service and want to shutdown the whole container if my bot service exits
so i have my normal shutdown logic for my bot and it exits normally with 0 but the database service keeps running
i tried to configure that the db depends on the bot but it didnt change anything
iirc there is a option within docker-compose.yml that depends on another container being up
(and the bot rather depends on the db on startup)
are all these services running in the same container?
then doesn't docker compose down work?
providing its being run in the same container
it will bring all services down
this
dunno why you should shutdown the bot container and not the whole docker-compose setup
nono it works perfectly. i want to use /shutdown on my discord bot and it shut down the container its inside
I don't think its possible to shut individual services down like that tho I have limited use with docker so take my word with a grain of salt
you can do a crackhead solution and pass through the docker socket to control it
bad idea though
😐
since that gives you access to all of your containers
||Check the image i sent :/||
docker compose up --build --abort-on-container-exit i mean when i start my container with this it works since the bot service exits and the docker stops the remaining services
but i thought of a more elegant solution
Don't be impatient, you see us helping someone else rn
wait your turn
show code
still
I am confused, if you want it to stop all services when your bot process exits
just execute docker compose down on /shutdown
perhaps thats what you're looking into
At this point im still confused on what they are wanting
It sounds like to me they are wanting to shut the entire container down
yes
version: '3'
services:
container1:
image: your-image
# other container1 options
container2:
image: your-image
depends_on:
- container1
# other container2 options
as an example
then use docker compose down whenever you /shutdown
$nomention
$var[apikey;TOKEN TOPGG]
$var[normal_color;#ff3366]
$var[success_color;#08b278]
$httpAddHeader[authorization;$var[apikey]]
$httpGet[https://top.gg/api/bots/$botID/check?userId=$authorID]
$if[$checkContains[$httpResult[voted];1]==true]
$var[voted;true]
$else
$var[voted;false]
$endif
$if[$var[voted]==true]
$title[Reward claimed!]
$description[You successfully claimed your reward.
You can claim another reward by [voting again\](https://top.gg/bot/$botID/vote) in **12 hours** from the time you last voted.]
$footer[Thank you for the vote ❤️]
$color[$var[success_color]]
$image[https://top.gg/api/widget/$botID.png]
$cooldown[12h;You can claim your next vote reward in **%time%**.]
$else
$title[Vote to claim!]
$description[You need to **vote** to claim your reward, [click here\](https://top.gg/bot/$botID/vote) or the button under this message to vote.
You can vote for the bot and claim your reward each **12 hours**.]
$addButton[no;https://top.gg/bot/$botID/vote;Vote for me!;link;]
$color[$var[normal_color]]
$endif
$image[https://top.gg/api/widget/$botID.png]
because why should the container keeps on running if the bot is down
easy way to do it
issue being
what you are doing is a hacky solution that I don't recommend
you cant execute that within the container
unless you passthrough the docker socket
which exposes all of your containers
@lyric mountain
i tried doing that from within yea
yes I saw it
try this one SirTimme
I highly suggest reading the example too here to understand it more
I suppose u put the actual token where TOKEN TOPGG is right?
version: '3.6'
name: alpagotchi
services:
database:
container_name: database
image: postgres
restart: on-failure
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- pg-data:/var/lib/postgresql/data
ports:
- "5432:5432"
bot:
container_name: bot
build:
context: .
dockerfile: Dockerfile
args:
TOKEN: ${TOKEN}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_URL: ${POSTGRES_URL}
depends_on:
- database
restart: on-failure
adminer:
container_name: adminer
image: adminer
depends_on:
- database
restart: on-failure
ports:
- "8080:8080"
volumes:
pg-data:
name: pg-data
thahts my config
Yes
because the bot needs to wait for the db on startup
adminer being your bot?
are u trying to check votes for your own bot?
sir what is TOKEN? I need that information 
The whole token
no bot, adminer is postgres GUI
Ye
so you want to:
shut down database and adminer when the bot container shuts down right?
yes :D
then depend_on both the database and adminer on bot
if one shuts down the others do as well
So if i do claim it will say u havnt voted.. if you have it will send the message u have voted. And there will be 12hr cooldown
might get issues on the depend of database on the bot service tho

just see what happens
well, I dont see any issue with it, try sending a raw http request to see if you missed something
Only after it gets that if the user vited the cooldown would work
like through wget
yea i was wondering if its a circular dependency
I don't understand why people even use docker for bots no offense to you SirTimme
Like?
ensure you're passing contentType json
Raw http? Means?
tryitandsee
see if it explodes
...just said it
cycle found: database -> bot -> database welp
:/
wget, for example








