From 9e45d0412184c411cdc20cffa5f34e6c7c8e5f89 Mon Sep 17 00:00:00 2001 From: samvaio Date: Tue, 29 Nov 2016 05:25:47 +0530 Subject: [PATCH 01/10] Linux Guide updated with latest Linux AIO installer commands. --- docs/guides/Linux Guide.md | 64 +++++++++++++++++++++++++------------- 1 file changed, 43 insertions(+), 21 deletions(-) diff --git a/docs/guides/Linux Guide.md b/docs/guides/Linux Guide.md index 8874c3d3..59280b3b 100644 --- a/docs/guides/Linux Guide.md +++ b/docs/guides/Linux Guide.md @@ -92,9 +92,19 @@ sudo apt-get update && sudo apt-get install ffmpeg -y ####Getting NadekoBot -![img6](https://cdn.discordapp.com/attachments/251504306010849280/251505587089571850/getting_nadeko.gif) +Use the following command to get and run `linuxAIO.sh`: +(Remember **DO NOT** rename the file `linuxAIO.sh`) -`cd ~ && curl -L https://github.com/Kwoth/NadekoBot-BashScript/raw/master/nadeko_installer.sh | sh` +`cd ~ && wget https://github.com/Kwoth/NadekoBot-BashScript/raw/master/linuxAIO.sh && bash linuxAIO.sh` + +Follow the on screen instructions: + +1. To Get the latest build. (most recent updates) +2. To Get the stable build. + +Choose either `1` or `2` then press `enter` key. +Once Installation is completed you should see the options again. +Next, choose `5` to exit. ####Creating and Inviting bot @@ -141,8 +151,8 @@ sudo apt-get update && sudo apt-get install ffmpeg -y - Copy the `credentials.json` to desktop - EDIT it as it is guided here: [Setting up credentials.json](http://nadekobot.readthedocs.io/en/1.0/guides/Windows%20Guide/#setting-up-credentialsjson-file) - Paste/put it back in the folder once done. `(Using CyberDuck/WinSCP)` -- If you already have Nadeko 1.0 setup and have `credentials.json` and `NadekoBot.db`, you can just copy and paste the `credentials.json` to `NadekoBot/src/NadekoBot` and `NadekoBot.db` to `NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.0/data` using CyberDuck. -- If you have Nadeko 0.9x follow the [Upgrading Guide](http://nadekobot.readthedocs.io/en/1.0/guides/Upgrading%20Guide/) +- **If** you already have Nadeko 1.0 setup and have `credentials.json` and `NadekoBot.db`, you can just copy and paste the `credentials.json` to `NadekoBot/src/NadekoBot` and `NadekoBot.db` to `NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.0/data` using CyberDuck. +- **If** you have Nadeko 0.9x follow the [Upgrading Guide](http://nadekobot.readthedocs.io/en/1.0/guides/Upgrading%20Guide/) ####Setting up Music @@ -152,32 +162,33 @@ Once done, go back to **PuTTY** ####Running NadekoBot -![img8](https://cdn.discordapp.com/attachments/251504306010849280/251506149973557259/running_nadeko.gif) - **Create a new Session:** - `tmux new -s nadeko` -That command will create a new session named **nadeko** *(you can replace “nadeko” with anything you prefer and remember its your session name)* so you can run the bot in background without having to keep running the PuTTY. +The above command will create a new session named **nadeko** *(you can replace “nadeko” with anything you prefer and remember its your session name)* so you can run the bot in background without having to keep the PuTTY running. -- `cd NadekoBot/src/NadekoBot/` +Next, we need to run `linuxAIO.sh` inorder to get the latest running scripts with patches: -**Without Auto Restart:** +- `cd ~ && bash linuxAIO.sh` -- `dotnet run --configuration Release` +From the options, -**With Auto Restart:** +Choose `3` To Run the bot normally. +**NOTE:** With option `3` (Running Normally), if you use `.die` [command](http://nadekobot.readthedocs.io/en/1.0/Commands%20List/#administration) in discord. The bot will shut down and will stay offline untill you manually run it again. (best if you want to check the bot.) -- `while :; do dotnet run -c Release; sleep 5s; done` +Choose `4` To Run the bot with Auto Restart. +**NOTE:** With option `4` (Running with Auto Restart), bot will auto run if you use `.die` [command](http://nadekobot.readthedocs.io/en/1.0/Commands%20List/#administration) making the command `.die` to be used as restart. -**NOTE:** With Auto Restart, bot will auto run if you use `.die` [command](http://nadekobot.readthedocs.io/en/1.0/Commands%20List/#administration) so you do not have to manual restart if you ever want to. -See how that happens below: +See how that happens: ![img9](https://cdn.discordapp.com/attachments/251504306010849280/251506312893038592/die_explaination.gif) +Also **Remember** that, while running with Auto Restart, you need to [close the tmux session](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#restarting-nadeko) to stop the bot completely. + **Now check your Discord, the bot should be online** -Now time to **move the bot to background** and to do that, press **CTRL+B+D** (this will detach the nadeko session using TMUX), and you can finally close PuTTY now. +Next to **move the bot to background** and to do that, press **CTRL+B+D** (this will detach the nadeko session using TMUX), and you can finally close PuTTY now. ####Some more Info (just in case) @@ -205,25 +216,36 @@ Open **PuTTY** and login as you have before, type `reboot` and hit Enter. - Kill your previous session, check with `tmux ls` - `tmux kill-session -t nadeko` (don't forget to replace "nadeko" to what ever you named your bot's session) -- Follow: [Running NadekoBot](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#running-nadekobot) +- [Run the bot again.](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#running-nadekobot) ####Updating Nadeko -- Connect to the terminal +- Connect to the terminal through PuTTY. +- `tmux kill-session -t nadeko` (don't forget to replace **nadeko** in the command to what ever you named your bot's session) - Make sure the bot is **not** running. -- `cd ~ && curl -L https://github.com/Kwoth/NadekoBot-BashScript/raw/master/nadeko_installer.sh | sh` (The same command used to install earlier) -- Run the bot again as normal. +- `tmux new -s nadeko` (**nadeko** is the name of the session) +- `cd ~ && bash linuxAIO.sh` +- Choose either `1` or `2` to update the bot with **latest build** or **stable build** respectively. +- Choose either `3` or `4` to run the bot again with **normally** or **auto restart** respectively. +- Done. You can close PuTTY now. ####Alternative way to Install -- If the [Nadeko installer](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#getting-nadekobot) shows errors, try manually installing with the following steps: +If the [Nadeko installer](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#getting-nadekobot) shows error, check if you have the `linuxAIO.sh` file and make sure its not renamed or manually install using the following command(s): + + +![img6](https://cdn.discordapp.com/attachments/251504306010849280/251505587089571850/getting_nadeko.gif) + +`cd ~ && curl -L https://github.com/Kwoth/NadekoBot-BashScript/raw/master/nadeko_installer.sh | sh` + +**OR** ``` cd ~ && git clone -b 1.0 --recursive --depth 1 https://github.com/Kwoth/NadekoBot.git cd ~/NadekoBot/discord.net/src/Discord.Net && dotnet restore && cd ../Discord.Net.Commands && dotnet restore && cd ../../../src/NadekoBot/ && dotnet restore && dotnet build --configuration Release ``` -- If you are still getting errors using the above steps: +If you are getting error using the above steps try: ``` cd ~/NadekoBot/discord.net && dotnet restore -s https://dotnet.myget.org/F/dotnet-core/api/v3/index.json && dotnet restore From 7d611f1ed8e003d99250e312f94c28eeaf60c2c2 Mon Sep 17 00:00:00 2001 From: samvaio Date: Tue, 29 Nov 2016 05:29:24 +0530 Subject: [PATCH 02/10] Update Linux Guide.md --- docs/guides/Linux Guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/Linux Guide.md b/docs/guides/Linux Guide.md index 59280b3b..862f35e2 100644 --- a/docs/guides/Linux Guide.md +++ b/docs/guides/Linux Guide.md @@ -168,7 +168,7 @@ Once done, go back to **PuTTY** The above command will create a new session named **nadeko** *(you can replace “nadeko” with anything you prefer and remember its your session name)* so you can run the bot in background without having to keep the PuTTY running. -Next, we need to run `linuxAIO.sh` inorder to get the latest running scripts with patches: +**Next, we need to run `linuxAIO.sh` in order to get the latest running scripts with patches:** - `cd ~ && bash linuxAIO.sh` From bdb347ef7cb2fcf9c8f110247ef8395724444e79 Mon Sep 17 00:00:00 2001 From: samvaio Date: Tue, 29 Nov 2016 07:22:24 +0530 Subject: [PATCH 03/10] Update Linux Guide.md --- docs/guides/Linux Guide.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/guides/Linux Guide.md b/docs/guides/Linux Guide.md index 862f35e2..3768d4ca 100644 --- a/docs/guides/Linux Guide.md +++ b/docs/guides/Linux Guide.md @@ -175,16 +175,16 @@ The above command will create a new session named **nadeko** *(you can replace From the options, Choose `3` To Run the bot normally. -**NOTE:** With option `3` (Running Normally), if you use `.die` [command](http://nadekobot.readthedocs.io/en/1.0/Commands%20List/#administration) in discord. The bot will shut down and will stay offline untill you manually run it again. (best if you want to check the bot.) +**NOTE:** With option `3` (Running Normally), if you use `.die` [command](http://nadekobot.readthedocs.io/en/1.0/Commands%20List/#administration) in discord. The bot will shut down and will stay offline until you manually run it again. (best if you want to check the bot.) Choose `4` To Run the bot with Auto Restart. -**NOTE:** With option `4` (Running with Auto Restart), bot will auto run if you use `.die` [command](http://nadekobot.readthedocs.io/en/1.0/Commands%20List/#administration) making the command `.die` to be used as restart. +**NOTE:** With option `4` (Running with Auto Restart), bot will auto run if you use `.die` [command](http://nadekobot.readthedocs.io/en/1.0/Commands%20List/#administration) making the command `.die` to function as restart. See how that happens: ![img9](https://cdn.discordapp.com/attachments/251504306010849280/251506312893038592/die_explaination.gif) -Also **Remember** that, while running with Auto Restart, you need to [close the tmux session](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#restarting-nadeko) to stop the bot completely. +**Remember** that, while running with Auto Restart, you will need to [close the tmux session](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#restarting-nadeko) to stop the bot completely. **Now check your Discord, the bot should be online** From 6dd457e1324969e2220a381e1312d2e019eca0e8 Mon Sep 17 00:00:00 2001 From: samvaio Date: Tue, 29 Nov 2016 07:29:59 +0530 Subject: [PATCH 04/10] Update Linux Guide.md --- docs/guides/Linux Guide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/Linux Guide.md b/docs/guides/Linux Guide.md index 3768d4ca..cbb7ecf8 100644 --- a/docs/guides/Linux Guide.md +++ b/docs/guides/Linux Guide.md @@ -221,7 +221,7 @@ Open **PuTTY** and login as you have before, type `reboot` and hit Enter. ####Updating Nadeko - Connect to the terminal through PuTTY. -- `tmux kill-session -t nadeko` (don't forget to replace **nadeko** in the command to what ever you named your bot's session) +- `tmux kill-session -t nadeko` (don't forget to replace **nadeko** in the command with the name of your bot's session) - Make sure the bot is **not** running. - `tmux new -s nadeko` (**nadeko** is the name of the session) - `cd ~ && bash linuxAIO.sh` @@ -231,7 +231,7 @@ Open **PuTTY** and login as you have before, type `reboot` and hit Enter. ####Alternative way to Install -If the [Nadeko installer](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#getting-nadekobot) shows error, check if you have the `linuxAIO.sh` file and make sure its not renamed or manually install using the following command(s): +If the [Nadeko installer](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#getting-nadekobot) shows any kind error, check if you have the `linuxAIO.sh` file and make sure its not renamed or if you want to manually install the bot. Use the following command(s): ![img6](https://cdn.discordapp.com/attachments/251504306010849280/251505587089571850/getting_nadeko.gif) From ed41b80ca980446d2e6e22d49f78eca3c480477b Mon Sep 17 00:00:00 2001 From: samvaio Date: Tue, 29 Nov 2016 19:49:00 +0530 Subject: [PATCH 05/10] Update OSX Guide.md --- docs/guides/OSX Guide.md | 74 ++++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 26 deletions(-) diff --git a/docs/guides/OSX Guide.md b/docs/guides/OSX Guide.md index a0dc6240..2d9a88a2 100644 --- a/docs/guides/OSX Guide.md +++ b/docs/guides/OSX Guide.md @@ -54,10 +54,19 @@ A dialog box will open asking if you want to install `xcode-select`. Select inst ####Downloading and building Nadeko -**METHOD I** +Use the following command to get and run `linuxAIO.sh`: +(Remember **DO NOT** rename the file `linuxAIO.sh`) -- `cd ~` -- `curl -L https://github.com/Kwoth/NadekoBot-BashScript/raw/master/nadeko_installer.sh | sh` +`cd ~ && wget https://github.com/Kwoth/NadekoBot-BashScript/raw/master/linuxAIO.sh && bash linuxAIO.sh` + +Follow the on screen instructions: + +1. To Get the latest build. (most recent updates) +2. To Get the stable build. + +Choose either `1` or `2` then press `enter` key. +Once Installation is completed you should see the options again. +Next, choose `5` to exit. ####Creating DiscordBot application - Go to [the Discord developer application page.][DiscordApp] @@ -101,15 +110,21 @@ A dialog box will open asking if you want to install `xcode-select`. Select inst - Start Nadeko using .NET Core: -`cd ~/NadekoBot/src/NadekoBot/` +`cd ~ && bash linuxAIO.sh` -`dotnet run --configuration Release` +From the options, -CHECK THE BOT IN DISCORD, IF EVERYTHING IS WORKING +Choose `3` To Run the bot normally. +**NOTE:** With option `3` (Running Normally), if you use `.die` [command](http://nadekobot.readthedocs.io/en/1.0/Commands%20List/#administration) in discord. The bot will shut down and will stay offline untill you manually run it again. (best if you want to check the bot.) -Now time to move bot to background and to do that, press CTRL+B+D (this will detach the nadeko session using TMUX) +Choose `4` To Run the bot with Auto Restart. +**NOTE:** With option `4` (Running with Auto Restart), bot will auto run if you use `.die` [command](http://nadekobot.readthedocs.io/en/1.0/Commands%20List/#administration) making the command `.die` to be used as restart. +**NOTE:** [To stop the bot you will have to kill the session.](http://nadekobot.readthedocs.io/en/1.0/guides/OSX%20Guide/#some-more-info) -*If you used Screen press CTRL+A+D (this will detach the nadeko screen)* +**Now check your Discord, the bot should be online** + +Now time to move bot to background and to do that, press CTRL+B+D (this will detach the nadeko session using TMUX) +If you used Screen press CTRL+A+D (this will detach the nadeko screen) ####Inviting your bot to your server - [Invite Guide](http://discord.kongslien.net/guide.html) @@ -125,24 +140,14 @@ For Music Setup and API keys check [Setting up NadekoBot for Music](http://nadek ####Updating Nadeko -Nadeko is really easy to update as of version 1.0! just copy and paste the command below to update Nadeko to the latest version - -`cd ~/NadekoBot/ && git init && git pull` - -####Alternative Method to Install Nadeko - -*If you fail to install the bot using [METHOD I](http://nadekobot.readthedocs.io/en/1.0/guides/OSX%20Guide/#downloading-and-building-nadeko) try:* - -**METHOD II** - -- `cd ~` -- `git clone -b 1.0 --recursive https://github.com/Kwoth/NadekoBot.git` -- `cd ~/NadekoBot/discord.net` -- `dotnet restore -s https://dotnet.myget.org/F/dotnet-core/api/v3/index.json` -- `dotnet restore` -- `cd ~/NadekoBot/src/NadekoBot/` -- `dotnet restore` -- `dotnet build --configuration Release` +- Connect to the terminal. +- `tmux kill-session -t nadeko` [(don't forget to replace **nadeko** in the command to what ever you named your bot's session)](http://nadekobot.readthedocs.io/en/1.0/guides/OSX%20Guide/#some-more-info) +- Make sure the bot is **not** running. +- `tmux new -s nadeko` (**nadeko** is the name of the session) +- `cd ~ && bash linuxAIO.sh` +- Choose either `1` or `2` to update the bot with **latest build** or **stable build** respectively. +- Choose either `3` or `4` to run the bot again with **normally** or **auto restart** respectively. +- Done. You can close terminal now. ####Some more Info @@ -158,6 +163,23 @@ Nadeko is really easy to update as of version 1.0! just copy and paste the comma - If you want to switch to/ see that screen, type `screen -r nadeko` (nadeko is the name of the screen we created before so, replace `nadeko` with the screen name you created.) - If you want to kill the NadekoBot screen, type `screen -X -S nadeko quit` +####Alternative Method to Install Nadeko + +**METHOD I** + +- `cd ~ && curl -L https://github.com/Kwoth/NadekoBot-BashScript/raw/master/nadeko_installer.sh | sh` + +**METHOD II** + +- `cd ~` +- `git clone -b 1.0 --recursive https://github.com/Kwoth/NadekoBot.git` +- `cd ~/NadekoBot/discord.net` +- `dotnet restore -s https://dotnet.myget.org/F/dotnet-core/api/v3/index.json` +- `dotnet restore` +- `cd ~/NadekoBot/src/NadekoBot/` +- `dotnet restore` +- `dotnet build --configuration Release` + [Homebrew]: http://brew.sh/ [DiscordApp]: https://discordapp.com/developers/applications/me [Atom]: https://atom.io/ From 84fc90645fc17ec7189d1f0bfa22229af4d653e9 Mon Sep 17 00:00:00 2001 From: samvaio Date: Tue, 29 Nov 2016 19:59:05 +0530 Subject: [PATCH 06/10] Update OSX Guide.md --- docs/guides/OSX Guide.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/guides/OSX Guide.md b/docs/guides/OSX Guide.md index 2d9a88a2..dce405c1 100644 --- a/docs/guides/OSX Guide.md +++ b/docs/guides/OSX Guide.md @@ -1,4 +1,5 @@ -### Setting Up NadekoBot on OSX +## Setting Up NadekoBot on OSX + #### Prerequisites - [Homebrew][Homebrew] - Google Account From 20766818af6d615518eb13a4b6472b9239fc5dd9 Mon Sep 17 00:00:00 2001 From: samvaio Date: Tue, 29 Nov 2016 21:12:34 +0530 Subject: [PATCH 07/10] Update Windows Guide.md --- docs/guides/Windows Guide.md | 40 +++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/docs/guides/Windows Guide.md b/docs/guides/Windows Guide.md index fdff6ea4..0cb51d07 100644 --- a/docs/guides/Windows Guide.md +++ b/docs/guides/Windows Guide.md @@ -2,7 +2,8 @@ ________________________________________________________________________________ *Thanks to @Flatbread and Mirai for making this guide* ________________________________________________________________________________ -### Setting Up NadekoBot on Windows +## Setting Up NadekoBot on Windows + #### Prerequisites - 1) [.NET Core SDK][.NET Core SDK] - 2) [Git][Git] @@ -11,18 +12,19 @@ ________________________________________________________________________________ - 5) Soundcloud Account (if you want soundcloud support) - 6) [7zip][7zip] (or whatever you are using, WinRar) - 7) [Notepad++][Notepad++] -- 8) Windows 8 or newer +- 8) Windows 8 or later ####Guide - Make sure you have installed both [Git][Git] and the [.NET Core SDK][.NET Core SDK]. -- Create a folder somewhere and name it `Nadeko`. -- Head to the [Windows Installer releases page][WinInstaller] and save the zip as prompted. -- Extract the contents of the zip you just downloaded to the `Nadeko` folder that we created earlier. -- You should see another folder in the `Nadeko` folder, something along the lines of `NadekoBotInstallerWin-master` copy the contents of this folder, to the `Nadeko` folder, then (optionally) remove the empty, `NadekoBotInstallerWin-master` folder -- You should now see three files, most importantly, `NadekoInstaller.bat` after moving the contents of the folder mentioned above to the `Nadeko` folder (You may not see the `.bat` part of the filename). -- Run/Launch/Open `NadekoInstaller.bat` and you will see it running in the command prompt. +- Create a **new folder** anywhere you like and name it `Nadeko`. +- Next, [Right-Click on this link](https://github.com/Kwoth/NadekoBotInstallerWin/raw/master/NadekoWinAIO.bat) and select **Save link as** and save the file `NadekoWinAIO.bat` inside the `Nadeko` folder that we created earlier. (**DO NOT** rename the file `NadekoWinAIO.bat`) +- Once that's done, double-click on `NadekoWinAIO.bat` to run it. +- From the options, + - Choose `1` to get the **most recent build**. + - Choose `2` to get the **stable build**. - Wait a while for the file to finish installing, it'll display it's progress in the command prompt. - You should now have a new folder named `NadekoBot` inside the `Nadeko` folder we previously created. +- Once that's done press any key to close the command prompt. ####Creating DiscordBot application - Go to [the Discord developer application page][DiscordApp]. @@ -57,14 +59,24 @@ ________________________________________________________________________________ - The bot should have been added to your server. ####Starting the bot -- Go to the folder which you extracted the zip to earlier, and run the `NadekoRun.bat` file -- Your bot should now be online in the server we added her to. -- Note: Your bot will be offline in case you close the `NadekoBot` command prompt window. +- Go to the `Nadeko` folder that we have created earlier, and run the `NadekoWinAIO.bat` file. +- From the options, + - Choose `3` to **run the bot normally**. + (with normal-run the bot will shutdown and will stay offline if it disconnects by the use of `.die` command until you manually run it again. Useful if you want to test the bot.) + - Choose `4` to **run the bot with auto restart**. + (with auto restart the bot will restart itself if it disconnects by the use of `.die` command. Useful if you want to have restart function for any reason without having to manually restart.) ####Updating NadekoBot - Make sure the bot is closed and is not running (Run `.die` in a connected server to ensure it's not running). -- Run `NadekoInstaller.bat` again and wait for it to finish. -- Run `NadekoRun.bat`. +- Once that's checked, go to the `Nadeko` folder. +- Run the `NadekoWinAIO.bat` file. +- From the options, + - Choose `1` to get the **most recent build**. + - Choose `2` to get the **stable build**. +- Follow the messages and press any key to continue. +- Wait for it to finish. +- Press any key to close the window when it shows **Installation complete.** +- [Start the bot again.](http://nadekobot.readthedocs.io/en/1.0/guides/Windows%20Guide/#starting-the-bot) - You've updated and are running again, easy as that! ________________________________________________________________________________ @@ -99,7 +111,7 @@ ________________________________________________________________________________ - Setup your API keys as explained above. - Restart your computer. -[.NET Core SDK]: https://go.microsoft.com/fwlink/?LinkID=827524 +[.NET Core SDK]: https://www.microsoft.com/net/core#windowscmd [Git]: https://git-scm.com/download/win [WinInstaller]: https://github.com/Kwoth/NadekoBotInstallerWin/archive/master.zip [FFMPEG]: https://github.com/Soundofdarkness/FFMPEG-Inst/releases From 159bed5552553f0f97b4e23892373a7dbedb2979 Mon Sep 17 00:00:00 2001 From: samvaio Date: Tue, 29 Nov 2016 21:16:17 +0530 Subject: [PATCH 08/10] Update Windows Guide.md --- docs/guides/Windows Guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/Windows Guide.md b/docs/guides/Windows Guide.md index 0cb51d07..1b063fa1 100644 --- a/docs/guides/Windows Guide.md +++ b/docs/guides/Windows Guide.md @@ -24,7 +24,7 @@ ________________________________________________________________________________ - Choose `2` to get the **stable build**. - Wait a while for the file to finish installing, it'll display it's progress in the command prompt. - You should now have a new folder named `NadekoBot` inside the `Nadeko` folder we previously created. -- Once that's done press any key to close the command prompt. +- Once Installation is completed, press any key to close the command prompt. ####Creating DiscordBot application - Go to [the Discord developer application page][DiscordApp]. From 07ff8bf654e9138ec70654784706d94d94c9d9fb Mon Sep 17 00:00:00 2001 From: samvaio Date: Tue, 29 Nov 2016 21:17:23 +0530 Subject: [PATCH 09/10] Update Windows Guide.md --- docs/guides/Windows Guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/Windows Guide.md b/docs/guides/Windows Guide.md index 1b063fa1..200ed699 100644 --- a/docs/guides/Windows Guide.md +++ b/docs/guides/Windows Guide.md @@ -64,7 +64,7 @@ ________________________________________________________________________________ - Choose `3` to **run the bot normally**. (with normal-run the bot will shutdown and will stay offline if it disconnects by the use of `.die` command until you manually run it again. Useful if you want to test the bot.) - Choose `4` to **run the bot with auto restart**. - (with auto restart the bot will restart itself if it disconnects by the use of `.die` command. Useful if you want to have restart function for any reason without having to manually restart.) + (with auto restart the bot will restart itself if it disconnects by the use of `.die` command. Useful if you want to have restart function for any reason.) ####Updating NadekoBot - Make sure the bot is closed and is not running (Run `.die` in a connected server to ensure it's not running). From 5d3b99c445c6c40fcfc3ba8f39f77e20849690e4 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Tue, 29 Nov 2016 19:36:53 +0100 Subject: [PATCH 10/10] added install scripts --- scripts/NadekoAutoRun.bat | 6 ++ scripts/NadekoInstaller.bat | 110 ++++++++++++++++++++++++++++++ scripts/NadekoInstallerLatest.bat | 110 ++++++++++++++++++++++++++++++ scripts/NadekoRun.bat | 9 +++ 4 files changed, 235 insertions(+) create mode 100644 scripts/NadekoAutoRun.bat create mode 100644 scripts/NadekoInstaller.bat create mode 100644 scripts/NadekoInstallerLatest.bat create mode 100644 scripts/NadekoRun.bat diff --git a/scripts/NadekoAutoRun.bat b/scripts/NadekoAutoRun.bat new file mode 100644 index 00000000..af1b87d5 --- /dev/null +++ b/scripts/NadekoAutoRun.bat @@ -0,0 +1,6 @@ +@ECHO off +@TITLE NadekoBot +:auto +CD /D %~dp0NadekoBot\src\NadekoBot +dotnet run --configuration Release +goto auto diff --git a/scripts/NadekoInstaller.bat b/scripts/NadekoInstaller.bat new file mode 100644 index 00000000..f52d1e07 --- /dev/null +++ b/scripts/NadekoInstaller.bat @@ -0,0 +1,110 @@ +@ECHO off +TITLE Downloading NadekoBot, please wait +::Setting convenient to read variables which don't delete the windows temp folder +SET root=%~dp0 +CD /D %root% +SET rootdir=%cd% +SET build1=%root%NadekoInstall_Temp\NadekoBot\discord.net\src\Discord.Net\ +SET build2=%root%NadekoInstall_Temp\NadekoBot\discord.net\src\Discord.Net.Commands\ +SET build3=%root%NadekoInstall_Temp\NadekoBot\src\NadekoBot\ +SET installtemp=%root%NadekoInstall_Temp\ +::Deleting traces of last setup for the sake of clean folders, if by some miracle it still exists +IF EXIST %installtemp% ( RMDIR %installtemp% /S /Q >nul 2>&1) +::Checks that both git and dotnet are installed +dotnet --version >nul 2>&1 || GOTO :dotnet +git --version >nul 2>&1 || GOTO :git +::Creates the install directory to work in and get the current directory because spaces ruins everything otherwise +:start +MKDIR NadekoInstall_Temp +CD /D %installtemp% +::Downloads the latest version of Nadeko +ECHO Downloading Nadeko... +ECHO. +git clone -b 1.0 --recursive --depth 1 --progress https://github.com/Kwoth/NadekoBot.git >nul +IF %ERRORLEVEL% EQU 128 (GOTO :giterror) +TITLE Installing NadekoBot, please wait +ECHO. +ECHO Installing... +::Building Nadeko +CD /D %build1% +dotnet restore >nul 2>&1 +CD /D %build2% +dotnet restore >nul 2>&1 +CD /D %build3% +dotnet restore >nul 2>&1 +dotnet build --configuration Release >nul 2>&1 +::Attempts to backup old files if they currently exist in the same folder as the batch file +IF EXIST "%root%NadekoBot\" (GOTO :backupinstall) +:freshinstall + ::Moves the NadekoBot folder to keep things tidy + ROBOCOPY "%root%NadekoInstall_Temp" "%rootdir%" /E /MOVE >nul 2>&1 + IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) + GOTO :end +:backupinstall + TITLE Backing up old files + ECHO. + ECHO Make sure to close any files such as NadekoBot.db before PRESSing ANY KEY TO CONTINUE to prevent data loss + PAUSE >nul 2>&1 + ::Recursively copies all files and folders from NadekoBot to NadekoBot_Old + ROBOCOPY "%root%NadekoBot" "%root%NadekoBot_Old" /MIR >nul 2>&1 + IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) + ECHO. + ECHO Old files backed up to NadekoBot_Old + ::Copies the credentials and database from the backed up data to the new folder + COPY "%root%NadekoBot_Old\src\NadekoBot\credentials.json" "%installtemp%NadekoBot\src\NadekoBot\credentials.json" >nul 2>&1 + IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) + ECHO. + ECHO credentials.json copied to new folder + ROBOCOPY "%root%NadekoBot_Old\src\NadekoBot\bin" "%installtemp%NadekoBot\src\NadekoBot\bin" /E >nul 2>&1 + IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) + ECHO. + ECHO Old bin folder copied to new folder + ROBOCOPY "%root%NadekoBot_Old\src\NadekoBot\data" "%installtemp%NadekoBot\src\NadekoBot\data" /E >nul 2>&1 + IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) + ECHO. + ECHO Old data folder copied to new folder + ::Moves the setup Nadeko folder + RMDIR "%root%NadekoBot\" /S /Q >nul 2>&1 + ROBOCOPY "%root%NadekoInstall_Temp" "%rootdir%" /E /MOVE >nul 2>&1 + IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) + GOTO :end +:dotnet + ::Terminates the batch script if it can't run dotnet --version + TITLE Error! + ECHO dotnet not found, make sure it's been installed as per the guides instructions! + ECHO Press any key to exit. + PAUSE >nul 2>&1 + CD /D "%root%" + GOTO :EOF +:git + ::Terminates the batch script if it can't run git --version + TITLE Error! + ECHO git not found, make sure it's been installed as per the guides instructions! + ECHO Press any key to exit. + PAUSE >nul 2>&1 + CD /D "%root%" + GOTO :EOF +:giterror + ECHO. + ECHO Git clone failed, trying again + RMDIR %installtemp% /S /Q >nul 2>&1 + GOTO :start +:copyerror + ::If at any point a copy error is encountered + TITLE Error! + ECHO. + ECHO An error in copying data has been encountered, returning an exit code of %ERRORLEVEL% + ECHO. + ECHO Make sure to close any files, such as `NadekoBot.db` before continuing or try running the installer as an Administrator + PAUSE >nul 2>&1 + CD /D "%root%" + GOTO :EOF +:end + ::Normal execution of end of script + TITLE Installation complete! + CD /D "%root%" + RMDIR /S /Q "%installtemp%" >nul 2>&1 + ECHO. + ECHO Installation complete, press any key to close this window! + PAUSE >nul 2>&1 + del NadekoStable.bat diff --git a/scripts/NadekoInstallerLatest.bat b/scripts/NadekoInstallerLatest.bat new file mode 100644 index 00000000..8cb53ee4 --- /dev/null +++ b/scripts/NadekoInstallerLatest.bat @@ -0,0 +1,110 @@ +@ECHO off +TITLE Downloading NadekoBot, please wait +::Setting convenient to read variables which don't delete the windows temp folder +SET root=%~dp0 +CD /D %root% +SET rootdir=%cd% +SET build1=%root%NadekoInstall_Temp\NadekoBot\discord.net\src\Discord.Net\ +SET build2=%root%NadekoInstall_Temp\NadekoBot\discord.net\src\Discord.Net.Commands\ +SET build3=%root%NadekoInstall_Temp\NadekoBot\src\NadekoBot\ +SET installtemp=%root%NadekoInstall_Temp\ +::Deleting traces of last setup for the sake of clean folders, if by some miracle it still exists +IF EXIST %installtemp% ( RMDIR %installtemp% /S /Q >nul 2>&1) +::Checks that both git and dotnet are installed +dotnet --version >nul 2>&1 || GOTO :dotnet +git --version >nul 2>&1 || GOTO :git +::Creates the install directory to work in and get the current directory because spaces ruins everything otherwise +:start +MKDIR NadekoInstall_Temp +CD /D %installtemp% +::Downloads the latest version of Nadeko +ECHO Downloading Nadeko... +ECHO. +git clone -b dev --recursive --depth 1 --progress https://github.com/Kwoth/NadekoBot.git >nul +IF %ERRORLEVEL% EQU 128 (GOTO :giterror) +TITLE Installing NadekoBot, please wait +ECHO. +ECHO Installing... +::Building Nadeko +CD /D %build1% +dotnet restore >nul 2>&1 +CD /D %build2% +dotnet restore >nul 2>&1 +CD /D %build3% +dotnet restore >nul 2>&1 +dotnet build --configuration Release >nul 2>&1 +::Attempts to backup old files if they currently exist in the same folder as the batch file +IF EXIST "%root%NadekoBot\" (GOTO :backupinstall) +:freshinstall + ::Moves the NadekoBot folder to keep things tidy + ROBOCOPY "%root%NadekoInstall_Temp" "%rootdir%" /E /MOVE >nul 2>&1 + IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) + GOTO :end +:backupinstall + TITLE Backing up old files + ECHO. + ECHO Make sure to close any files such as NadekoBot.db before PRESSing ANY KEY TO CONTINUE to prevent data loss + PAUSE >nul 2>&1 + ::Recursively copies all files and folders from NadekoBot to NadekoBot_Old + ROBOCOPY "%root%NadekoBot" "%root%NadekoBot_Old" /MIR >nul 2>&1 + IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) + ECHO. + ECHO Old files backed up to NadekoBot_Old + ::Copies the credentials and database from the backed up data to the new folder + COPY "%root%NadekoBot_Old\src\NadekoBot\credentials.json" "%installtemp%NadekoBot\src\NadekoBot\credentials.json" >nul 2>&1 + IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) + ECHO. + ECHO credentials.json copied to new folder + ROBOCOPY "%root%NadekoBot_Old\src\NadekoBot\bin" "%installtemp%NadekoBot\src\NadekoBot\bin" /E >nul 2>&1 + IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) + ECHO. + ECHO Old bin folder copied to new folder + ROBOCOPY "%root%NadekoBot_Old\src\NadekoBot\data" "%installtemp%NadekoBot\src\NadekoBot\data" /E >nul 2>&1 + IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) + ECHO. + ECHO Old data folder copied to new folder + ::Moves the setup Nadeko folder + RMDIR "%root%NadekoBot\" /S /Q >nul 2>&1 + ROBOCOPY "%root%NadekoInstall_Temp" "%rootdir%" /E /MOVE >nul 2>&1 + IF %ERRORLEVEL% GEQ 8 (GOTO :copyerror) + GOTO :end +:dotnet + ::Terminates the batch script if it can't run dotnet --version + TITLE Error! + ECHO dotnet not found, make sure it's been installed as per the guides instructions! + ECHO Press any key to exit. + PAUSE >nul 2>&1 + CD /D "%root%" + GOTO :EOF +:git + ::Terminates the batch script if it can't run git --version + TITLE Error! + ECHO git not found, make sure it's been installed as per the guides instructions! + ECHO Press any key to exit. + PAUSE >nul 2>&1 + CD /D "%root%" + GOTO :EOF +:giterror + ECHO. + ECHO Git clone failed, trying again + RMDIR %installtemp% /S /Q >nul 2>&1 + GOTO :start +:copyerror + ::If at any point a copy error is encountered + TITLE Error! + ECHO. + ECHO An error in copying data has been encountered, returning an exit code of %ERRORLEVEL% + ECHO. + ECHO Make sure to close any files, such as `NadekoBot.db` before continuing or try running the installer as an Administrator + PAUSE >nul 2>&1 + CD /D "%root%" + GOTO :EOF +:end + ::Normal execution of end of script + TITLE Installation complete! + CD /D "%root%" + RMDIR /S /Q "%installtemp%" >nul 2>&1 + ECHO. + ECHO Installation complete, press any key to close this window! + PAUSE >nul 2>&1 + del NadekoLatest.bat diff --git a/scripts/NadekoRun.bat b/scripts/NadekoRun.bat new file mode 100644 index 00000000..207fb278 --- /dev/null +++ b/scripts/NadekoRun.bat @@ -0,0 +1,9 @@ +@ECHO off +@TITLE NadekoBot +CD /D %~dp0NadekoBot\src\NadekoBot +dotnet run --configuration Release +ECHO NadekoBot has been succesfully stopped, press any key to close this window. +TITLE NadekoBot - Stopped +CD /D %~dp0 +PAUSE >nul 2>&1 +del NadekoRunNormal.bat