#registering commands

1 messages · Page 1 of 1 (latest)

frank frost
#

T

#

Okay so basically you can just make a command to upload your commands

umbral oar
#

i dont want to do that, since historically i will forget about it

frank frost
#

Or put it on a cronjob

#

Once a day

#

Maybe

finite rampart
#

why do you need to reload commands?

umbral oar
#

because they change?

frank frost
#

But you finish work on your commands for the day, you put it on the live bot and reload it

frank frost
finite rampart
frank frost
#

They want to only update the ones that are changed

#

Which is not possible but also not necessary

umbral oar
umbral oar
frank frost
frank frost
umbral oar
frank frost
#

Overengineering at its finest

polar leaf
#

it is a simple chore to register commands, to be honest to forget registering is not understandable

umbral oar
#

why is that overengeneering?

frank frost
#

Because you are looking for an extremely complex thing whole the solution is writing down that you have to do it

umbral oar
frank frost
#

Look it's super easy it's 1 command and you push all commands

polar leaf
#

this is not a healthy conversation

sly shard
#

Do you not use two separate bot instances? One for live one for dev?

frank frost
frank frost
#

Don't make this more complex just bloody register the commands when youre done

#

Good luck, happy day to you.

umbral oar
#

thanks Kiter

sly shard
#

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.

umbral oar
#

happy day to you too

frank frost
#

Thanks Bird_love

polar leaf
#

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

frank frost
#

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

umbral oar
#

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

polar leaf
#

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

frank frost
sly shard
#

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

frank frost
#

If they can't run a single command

polar leaf
#

I feel like I am talking about simplest things with the longest way to talk

frank frost
#

Babahaah

sly shard
frank frost
#

They forget to push the command

#

As far as I understand now

umbral oar
#

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

sly shard
polar leaf
#

yeah............ make yourself seems the answer. since djs does not have such things

frank frost
umbral oar
frank frost
#

Don't worry about the api

umbral oar
frank frost
#

Hitting any sort of limit is tough

sly shard
frank frost
#

If you do, sucks next time don't do it

frank frost
#

1 command

umbral oar
frank frost
#

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

sly shard
umbral oar
#

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 🤷

sly shard
#

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

umbral oar
#

alr, i just thought it was easy. silly me

frank frost
#

Xd

#

Nothing ever comes easy in this world

#

Apart from food

#

Eating is easy

#

I wish you all good food

sly shard
#

The minimum API calls will be 1, 1 to get, or 1 to put

#

Better do 1 to put to save lines of code

umbral oar
#

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

lament shadow
#

just use set() (PUT request)
it wont count toward the daily limit if the command is unchanged

sly shard
sly shard
#

so just do set() like above, 1 api call

frank frost
#

I'm so glad for the thread

umbral oar
#

im comparing two local versions

frank frost
#

Imagine this in the channel lol

umbral oar
#

but yeah i can do set(). just wondering

sly shard
#

You need to cache the API call into the json

umbral oar
#

if its empty, then its not matching up, therefore the part of the code where its gonna update the JSON is called

sly shard
#

Well, if that solves the issue, go for it

#

btw if you want to save storage, use a checksum

umbral oar
#

it's one way. but it's much more work then i anticipated and i agree that this way im overengineering things

sly shard
#

Overengineering regardless

#

All you need is to set commands on launch