#registering commands
1 messages · Page 1 of 1 (latest)
i dont want to do that, since historically i will forget about it
why do you need to reload commands?
because they change?
But you finish work on your commands for the day, you put it on the live bot and reload it
Your commands shouldn't change much when they are done tbh
yeah but why not just update them when they change
They want to only update the ones that are changed
Which is not possible but also not necessary
my bot is an interactive game, i have new ideas for additions all the time 🤷
correction, i only want to update when any are changed
Yes so you can add the commands and push them to global when done working on them
Thats even worse zd
sure can do, but i will forget to reload the commands because i am just forgetful like that.
Overengineering at its finest
it is a simple chore to register commands, to be honest to forget registering is not understandable
why is that overengeneering?
Because you are looking for an extremely complex thing whole the solution is writing down that you have to do it
if you are just here to judge my memory, it's not really helping
Look it's super easy it's 1 command and you push all commands
this is not a healthy conversation
Do you not use two separate bot instances? One for live one for dev?
My memory is 100% worse than yours, don't dwell on what you can't do but find a way to make it work
yes i do
No no please
how do you know that?
Don't make this more complex just bloody register the commands when youre done
Good luck, happy day to you.
thanks Kiter
So use your dev as guild commands, and if you want to overengineer, as part of your build script, compile it as global. If you really want to overengineer.
happy day to you too
Thanks 
idk why are you so skeptical when the real soulution comes for you
just try it, eh? its kinda good
and pretty sure you'll get used to it
It's about habits👍
Get into the habit of updating when you finish a command
Write it down, put a timer on your phone
You cannot forget if you do not want to forget
Unless you have extensive brain damage
In which case you are excused
honestly i didnt think it would be that complex of a thing tbh. the way my code works i already have it go through my commands folder and put it in a collection. so i thought i just add 3 lines where it checks if the name, description and options are the same, and if not, then tell it to reload the commands which is also already part of my code
after all registering commands by hand is the most recommended way to register commands,
for not spamming the api, and make sure of your job doing
Yea but they will surely forget that
It's not complex, it's a one line change to go from guild commands to global commands, or if you programmed it right, you could just use a live/dev flag which you can set in your build arguments
If they can't run a single command
yes i already have that
I feel like I am talking about simplest things with the longest way to talk
Welcome to djs
Babahaah
So what is the issue, exactly?
i just wanted to not spam it by needlessly making requests while also not having to do it by hand so i dont forget 🤷 but if its that hard, i can do it by hand, i guess
i just thought it would be a very simple thing to add
to automate it
Then use a build script to deploy, simple answer with a simple solution
yeah............ make yourself seems the answer. since djs does not have such things
It is tho🙁
i just wanted to only reload it when there are actual changes to the name, description or options. but i guess it doesnt matter
Don't worry about the api
well apparently not
Hitting any sort of limit is tough
Then register a guild command called /deploy to deploy your new global commands?
If you do, sucks next time don't do it
That's too easy lol
1 command
yeah i can do that, i just thought it would be easier to just automate it because i thought it would be a 3 liner. i understand already that i need to do it differently, yall said it enough times
All you have to do is remember to add the commands to wherever you register them and use the command
Even making a button
You click the button they get updated
Automating it would be part of your build.sh if you are content on not registering commands on bot launch
yeah, i wanted to do it so everytime that my bot restarts, it would automatically compare for changes and then reload it when there are, but i guess i can reload by hand 🤷
Regardless, if you wanted to check if they changed, you'd need to do an API call to get commands, then another API call to set commands
So avoiding API calls isn't feasable
alr, i just thought it was easy. silly me
Xd
Nothing ever comes easy in this world
Apart from food
Eating is easy
I wish you all good food
Only other thing I would suggest is to store your current commands in a json file then compare the json file on launch, but you're still doing an API call
The minimum API calls will be 1, 1 to get, or 1 to put
Better do 1 to put to save lines of code
yeah, i mean i could do it so that the JSON has the old version, checks if they are the same as the new version, and if not, then reload the commands and update the json
just use set() (PUT request)
it wont count toward the daily limit if the command is unchanged
yup, but you're still doing an API call regardless to compare
oh really? didnt know that.
so just do set() like above, 1 api call
I'm so glad for the thread
why am i doing an API call?
im comparing two local versions
Imagine this in the channel lol
but yeah i can do set(). just wondering
how does your json file get populated originally then 🤣
You need to cache the API call into the json
if its empty, then its not matching up, therefore the part of the code where its gonna update the JSON is called
Well, if that solves the issue, go for it
btw if you want to save storage, use a checksum
it's one way. but it's much more work then i anticipated and i agree that this way im overengineering things