Merge pull request #797 from samdivaio/dev

Utility and Linux Guide Update
This commit is contained in:
Master Kwoth 2016-11-25 08:25:56 +01:00 committed by GitHub
commit 310992e3db
2 changed files with 76 additions and 19 deletions

View File

@ -6,6 +6,8 @@ If you want Nadeko to play music for you 24/7 without having to hosting it on yo
####Setting up NadekoBot
Assuming you have followed the link above to setup an account and Droplet with 64bit OS in Digital Ocean and got the `IP address and root password (in email)` to login, its time to get started.
**Go through this whole guide before setting up Nadeko**
#### Prerequisites
- Download [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
- Download [CyberDuck](https://cyberduck.io) or [WinSCP](https://winscp.net/eng/download.php)
@ -24,41 +26,39 @@ If you entered your Droplets IP address correctly, it should show **login as:**
####Installing Git
![img1](https://cdn.discordapp.com/attachments/251504306010849280/251504416019054592/git.gif)
`sudo apt-get install git -y`
**NOTE:** If the command is not being initiated, hit **Enter**
####Installing .NET Core SDK
![img2](https://cdn.discordapp.com/attachments/251504306010849280/251504746987388938/dotnet.gif)
Go to [this link](https://www.microsoft.com/net/core#ubuntu) provided by microsoft for instructions on how to get the most up to date version of the dotnet core sdk!
Make sure that you're on the correct page for your distribution of linux as the guides are different for the various distributions
We'll go over the steps here for Ubuntu 16.04 anyway (these will **only** work on Ubuntu 16.04), accurate as of 16/10/2016
We'll go over the steps here for Ubuntu 16.04 anyway (these will **only** work on Ubuntu 16.04), accurate as of 25/11/2016
```
sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update && sudo apt-get install dotnet-dev-1.0.0-preview2-003131 -y
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
sudo apt-get update && sudo apt-get install dotnet-dev-1.0.0-preview2.1-003177 -y
```
**NOTE:**
.NET CORE SDK only supports 64-bit Linux Operating Systems (Raspberry Pis are not supported because of this)
If you are running Ubuntu 16.10, follow these instructions before installing .NET Core:
- Go to [Download Page for libicu55_55.1-7_amd64.deb](http://packages.ubuntu.com/en/xenial/amd64/libicu55/download)
- Copy the link with a download option closest to you
- `wget <copied link>` (make sure it is downloaded) *e.g.* `wget http://mirrors.kernel.org/ubuntu/pool/main/i/icu/libicu55_55.1-7_amd64.deb`
- Install with: `dpkg i libicu55_55.1-7_amd64.deb`
- Now go back and install the .NET Core
**NOTE:** .NET CORE SDK only supports 64-bit Linux Operating Systems (Raspberry Pis are not supported because of this)
####Installing Opus Voice Codec and libsodium
![img3](https://cdn.discordapp.com/attachments/251504306010849280/251505294654308353/libopus.gif)
`sudo apt-get install libopus0 opus-tools libopus-dev libsodium-dev -y`
####Installing FFMPEG
![img4](https://cdn.discordapp.com/attachments/251504306010849280/251505443111829505/ffmpeg.gif)
`apt-get install ffmpeg -y`
**NOTE:** If you are running **UBUNTU 14.04**, you must run these first:
@ -86,13 +86,17 @@ sudo apt-get update && sudo apt-get install ffmpeg -y
####Installing TMUX
![img5](https://cdn.discordapp.com/attachments/251504306010849280/251505519758409728/tmux.gif)
`sudo apt-get install tmux -y`
####Getting NadekoBot
![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`
####Setting up and Inviting bot
####Creating and Inviting bot
- Read here how to [create a DiscordBot application](http://nadekobot.readthedocs.io/en/1.0/guides/Windows%20Guide/#creating-discordbot-application)
- [Visual Invite Guide](http://discord.kongslien.net/guide.html) *NOTE: Client ID is your Bot ID*
@ -102,7 +106,24 @@ sudo apt-get update && sudo apt-get install ffmpeg -y
- Go to the newly created link and pick the server we created, and click `Authorize`.
- The bot should have been added to your server.
####Setting up NadekoBot
####Guide for Advance Users
**Skip this step if you are a Regular User or New to Linux.**
[![img7][img7]](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#getting-nadekobot)
- Right after [Getting NadekoBot](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#getting-nadekobot)
- `cd NadekoBot/src/NadekoBot/` (go to this folder)
- `pico credentials.json` (open credentials.json to edit)
- Insert your bot's **Client ID, Bot ID** (should be same as your Client ID) **and Token** if you got it following [Creating and Inviting bot](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#creating-and-inviting-bot).
- Insert your own ID in Owners ID follow: [Setting up credentials.json](http://nadekobot.readthedocs.io/en/1.0/guides/Windows%20Guide/#setting-up-credentialsjson-file)
- And Google API from [Setting up NadekoBot for Music](http://nadekobot.readthedocs.io/en/1.0/guides/Windows%20Guide/#setting-up-nadekobot-for-music)
- Once done, press `CTRL+X`
- It will ask for "Save Modified Buffer?", press `Y` for yes
- It will then ask "File Name to Write" (rename), just hit `Enter` and Done.
- You can now move to [Running NadekoBot](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#running-nadekobot)
####Setting up SFTP
- Open **CyberDuck**
- Click on **Open Connection** (top-left corner), a new window should appear.
@ -131,30 +152,65 @@ 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.
- `cd NadekoBot/src/NadekoBot/`
**Without Auto Restart:**
- `dotnet run --configuration Release`
**With Auto Restart:**
- `while :; do dotnet run -c Release; sleep 5s; done`
**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:
![img9](https://cdn.discordapp.com/attachments/251504306010849280/251506312893038592/die_explaination.gif)
**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.
####Some more Info (just in case)
**Info about tmux:**
- If you want to **see the sessions** after logging back again, type `tmux ls`, and that will give you the list of sessions running.
- If you want to **switch to/ see that session**, type `tmux a -t nadeko` (**nadeko** is the name of the session we created before so, replace **“nadeko”** with the session name you created.)
- If you want to **kill** NadekoBot **session**, type `tmux kill-session -t nadeko`
####Restarting Nadeko with the Server
**If you are running Ubuntu 16.10, and having trouble installing .NET Core:**
- Go to [Download Page for libicu55_55.1-7_amd64.deb](http://packages.ubuntu.com/en/xenial/amd64/libicu55/download)
- Copy the link with a download option closest to you
- `wget <copied link>` *e.g.* `wget http://mirrors.kernel.org/ubuntu/pool/main/i/icu/libicu55_55.1-7_amd64.deb` (make sure it is downloaded)
- Install with: `dpkg i libicu55_55.1-7_amd64.deb`
- Now go back and install the .NET Core
####Restarting Nadeko
**Restarting Nadeko with the Server:**
Open **PuTTY** and login as you have before, type `reboot` and hit Enter.
**Restarting Manually:**
- 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)
####Updating Nadeko
- Make sure the bot is **not** running
- Connect to the terminal
- 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.
@ -173,3 +229,4 @@ cd ~/NadekoBot/discord.net/src/Discord.Net && dotnet restore && cd ../Discord.Ne
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
```
[img7]: https://cdn.discordapp.com/attachments/251504306010849280/251505766370902016/setting_up_credentials.gif