Updating Discord Bot Commands in Terminal - terminal

I have created a discord bot and was able to get it up and running without a problem in the past. I remember that I had to run two different commands in the terminal to get the bot up and running with no problems. The first command was something to get the bot commands updated in discord and the second was to actually get the bot online using
node bot.js
I need help figuring out what the first command is to get the bot commands updated on discord's server. I have rewatched all the videos that I followed before, but I cannot for the life of me find out what that command is.
I have a command handler that I followed off of the discord.js website when I first created the bot. I get the following error when adding a new file to my commands folder
[WARNING] The command at C:Desktop\DiscordBot\commands\play.js
is missing a required "data" or "execute" property.
There was a command that I had to run before running bot.js that fixed this issue.
I tried using the following command
build bot.js
but that obviously didn't work and isn't even a command at all.

this is what you need to know in order to update commands....but you're going to get downvoted if you don't post that you've shown you tried to find the answer yourself...
https://discordjs.guide/creating-your-bot/command-deployment.html#global-commands
The guide (link above) walks you through the steps, for update. you need to first register the new commands, every time you want to make a command syntax change. Once you've registered the commands with discord, then you can re-run your bot and it will see the updated changes. if you're doing this on a development server, it's best, because it's instantaneous. If you're doing this for multiple servers, then you need to update with global commands and it can take Discord up to an hour to propagate.

Related

My bot is suddenly not working from heroku anymore, it stopped appearing 'online'

I'm not sure what I've done wrong or what I haven't done but I was trying to update my bot program (which is something i often do), but this time it refused to work, and 'broke' my bot.
after logging in and typing in cmd>set HomeDrive=C:/Users/(windows name)/AppData/Local/heroku
the error Error: ENOENT: no such file or directory came up, which is strange since that is usually fixed by the above command, I googled it and discovered how to add a _netrc file, which I did.
Then I got the TypeError: __ new __() got an unexpected keyword argument 'deny_new' error, which I fixed by updating my discord.py and pip.
Now, everything seems to work fine, I type in cmd>git push heroku master, and everything deploys perfectly, as normal. However, when I toggle the repository on on the heroku website, my bot (no matter how many times & how long I wait) will not come online again.
Make sure you update the environment in the repository. The pipfile or requirements.txt It is better if you can specify the exact version that worked on your local PC.
also Make sure that the procfile and runtime.txt are correct.

heroku pg:psql keeps connecting but nothing happens afterwards

I'm new to Heroku and I've noticed that their page provides a tutorial on NodeJS where they go step by step on how to integrate a project or start a new project on their platform. Through the last step there's a section for databases, using postgres as an example, which happens to be the database type I'm looking to integrate in my project as well. However, after following through with the tutorial, I noticed that when executing heroku pg:psql, the Git Bash (what I used) keeps showing Connecting to [...] (the name of the database) and nothing else happens, effectively not allowing me to create rows and whatnot in the database so I can see them as part of the application. Have I gone wrong somewhere, or am I just missing something?
I have tried multiple ways to make sure it's connecting to the right database, I have even made a new database, however nothing works and the process keeps going endlessly. I've let it run for more than a day and still goes nowhere.
According to this source, https://devcenter.heroku.com/articles/getting-started-with-nodejs#provision-a-database, I should be connected to it with that bit of code there, however the only thing that I'm shown is --> Connecting to postgresql-animate-97685 .
I just had the same mistake and could not find a solution. I spent a lot of time to understand what needs to be done for this.
As a result, as I decided:
I originally used the console from Git Bash. Instead, I tried using the standard console from Windows - cmd. And it all worked out as per the instructions from Heroku.
By the way, this is not the first time that Git Bash fails me.
Hope that helped.

SCCM OSD TS End User Summary Screen

I am looking for a good way to make a summary to existing large build TS.
What I am working with is SCCM 2012r2 and what I need is a hint, how to capture all steps I want(some of them are in various groups) and put result of them in some sort of variable so at the end, someone who is building that PC will have a table showing lets say 30 of applications green and 4 of them red as a failure.
Can it be done in some easy way? I just need someone building the PC to see what app didn't install so he can install it manually or at least provide me more information before I'll dive into logs.
Thanks
I wouldn't say easy because it requires lots of steps and you have to do it per application manually basically but there is a TS Variable _SMSTSLastActionSucceeded which you could check after each installation step (you have to set the step to continue on error to make this work). So basically after you tried to install you check whether it worked and then set a TS variable of your choice to reflect the failure.
As a final step you implement a script that checks all your TS variables and outputs the result.
You could even use the addon OSDBackground to display your errors as the background image.
Some lengthy article how to implement a form of error handling can be found here however you would have to do this quite a bit different because in this example the ts fails at the first error and you want to continue and log but you should get the basic principles.

Is there any way to bypass or script Heroku's login prompt?

The Heroku Toolbelt's login prompt has started causing my continuous integration job to fail. I'm guessing something changed in a recent version, but since this project had been on the back-burner for a few months, I'm not sure exactly when that happened. I'll also admit that I don't remember how I had this working in the first place. It's possible that I did something similar to my answer below, but have no recollection of that.
Is there any way to script completion of the login prompt or bypass it entirely using environment variables/config?
Version information:
heroku-toolbelt/3.42.40 (x86_64-linux) ruby/2.2.2
heroku-cli/4.27.26-693efcb (amd64-linux) go1.6
I've tried manually logging into Heroku on the CI server, which creates a .netrc and copying that into my image, but it appears to be ignored.
Unfortunately, the only solution I was able to come up with was to build the Docker image, create a container, run heroku login inside of it, commit the changes and use the new image in my CI workflow.

Self Updating Shell Script

I am developing a gameserver shell script that has multiple smaller scripts for saving content, restarting, stopping, installing, updating, etc. Since this a script for the community, I need a way to allow me to work on it, and then push those changes to the users who use the script.
This is a basic concept of how I think it should work:
User runs the script
script downloads a version file off github
script reads the version string from github and tries to match it with the version listed in the script itself
if it doesn't match, download new script file (url never changes), replace and re-run the script
If this is something that seems possible (I assume it would), please inform me of the process.
This was demoed at docker con 2015 yesterday. But this might help. https://github.com/docker/notary

Resources