Added Guides

This commit is contained in:
miraai 2016-08-04 00:42:31 +02:00 committed by GitHub
parent 7adb1a17c1
commit b58469dde6
5 changed files with 434 additions and 0 deletions

View File

@ -0,0 +1,113 @@
________________________________________________________________________________
*Thanks to @Flatbread and Mirai for making this guide*
________________________________________________________________________________
### Setting Up NadekoBot on Windows
#### Prerequisites
- 1) [NET Framework][NET Framework] 4.5.2 (or 4.6)
- 2) [FFMPEG][FFMPEG]
- 3) Google Account
- 4) Soundcloud Account (if you want soundcloud support)
- 5) [7zip][7zip] (or whatever you are using, WinRar)
- 6) [Notepad++][Notepad++]
####Guide:
- Create a folder, name it `Nadeko`.
- Head to [Releases][Releases]* and download `WINDOWS.-.nadeupdater.7z`.
- Copy `WINDOWS.-.nadeupdater.7z` to the `Nadeko` (folder we created before) and extract everything.
- You will see a file `NadekoUpdater.bat ` and a folder `publish ` after extraction.
- Run/Launch/Open the file `NadekoUpdater.bat ` and you will see it running in cmd.exe asking you with **3 options** *1-3*.
- 1) Stable release - current stable release, but might not contain all the newest Nadeko updates.
- 2) Newest release - release with all features/upgrades.
- 3) Exit
- Press `2` on your keyboard and hit `Enter`. Type `y` and hit `Enter` again. Downloading might take a while, so just be patient and wait. When download is done, press `3` on your keyboard and close the updater.
- You should have a new folder named `NadekoBot` inside the `Nadeko` folder we previously created.
####Creating DiscordBot application
- Go to [DiscordApp][DiscordApp].
- Log in with your Discord account.
- On the left side, press `New Application`.
- Fill out the `App Name` (your bot's name, in this case), put the image you want, and add an app description(optional).
- Create the application.
- Once the application is created, click on `Create a Bot User` and confirm it.
- Keep this window open for now.
####Setting up Credentials.json file
- In our `NadekoBot` folder you should have `.json` file named `credentials_example.json`. (Note: If you do not see a **.json** after `credentials_example.json `, do not add the `**.json**`. You most likely have `"Hide file extensions"` enabled.)
- Rename `credentials_example.json` to `credentials.json`.
- Open the file with your [Notepad++][Notepad++].
- In there you will see fields like `Token`, `ClientId`, `BotId`, `OwnerIDs`.
- In your [DiscordApp][DiscordApp], under `Bot User` part, you will see the `Token:click to reveal` part, click to reveal it.
- Copy your bot's token, and put it between `" "` in your `credentials.json` file.
- Copy `Client ID` and replace it with the example one in your `credentials.json`.
- Copy `Bot ID` and replace it with the example one in your `credentials.json`.
- Save your `credentials.json` but keep it open. We need to put your `User ID` and owner.
####Inviting your bot to your server [Invite Guide][Invite Guide]
- Create a new server in Discord.
- Copy your `Client ID` from your [DiscordApp][DiscordApp].
- Replace `12345678` in this link `https://discordapp.com/oauth2/authorize?client_id=12345678&scope=bot&permissions=66186303` with your `Client ID`.
- Link should look like this: `https://discordapp.com/oauth2/authorize?client_id=**YOUR_CLENT_ID**&scope=bot&permissions=66186303`.
- Go to newly created link and pick the server we created, and click `Authorize`.
- Bot should be added to your server.
####Starting the bot
- Enter your `NadekoBot` folder that should be (hopefully) in your `Nadeko` folder.
- Run `NadekoBot.exe` (Note: There is `NadekoBot.exe` and `NadekoBot.exe.config`, dont run the second one)
- Your bot should now be online in the server we added him to.
- Note: Your bot will be offline in case you close `NadekoBot.exe`.
####Setting up OwnerIds
- In the server where your bot is, in a text channel, type `.uid`
- Your `User ID` should show, copy it.
- Close `NadekoBot.exe`
- Replace your `User ID` in the `credentials.json` between `[ ]` and save the changes.
- Run `NadekoBot.exe` again.
- Now you are the bot owner.
- You can add `User IDs` from the other users by separating IDs with a comma if you want to have more owners.
`*Alternatively, you can download nadekobot from [Releases][Releases] and extract the zip yourself. That is what updater does, except it makes it easier for you to update because it doesn't overwrite important files. If you are downloading releases you will have to be careful about your config, credentials, and other files you edited in order to preserve your data every time you update.`
________________________________________________________________________________
#### Setting Up NadekoBot For Music
##### Prerequisites
- 1) [FFMPEG][FFMPEG] installed.
- 2) Setting up API keys.
- Follow these steps on how to setup Google API keys:
- Go to [Google Console][Google Console] and log in.
- Create a new project (name does not matter). Once the project is created, go into "Enable and manage APIs."
- Under the "Other Popular APIs" section, enable `URL Shortener API` and `Custom Search Api`. Under the `YouTube APIs` section, enable `YouTube Data API`.
- On the left tab, access `Credentials`. Click `Create Credentials` button. Click on `API Key`, and then `Server Key` in the new window that appears. Enter in a name for the `Server Key`. A new window will appear with your `Google API key`.
- Copy the key.
- Open up `credentials.json`.
- For `"GoogleAPIKey"`, fill in with the new key we copied.
- Follow these steps on how to setup Soundcloud API key:
- Go to [Soundcloud][Soundcloud].
- Enter a name for the app and create it.
- You will see a page with the title of your app, and a field labeled `Client ID`. Copy the ID.
- In `credentials.json`, fill in `"SoundcloudClientID"` with the copied ID.
- Restart your computer.
##### Prerequisites for manual `ffmpeg` setup:
**Do this step in case you were not able to install `ffmpeg` with the installer.**
- Create a folder named `ffmpeg` in your main Windows directory. We will use **C:\ffmpeg** (for our guide)
- Download FFMPEG through the link https://ffmpeg.zeranoe.com/builds/ (download static build)
- Extract it using `7zip` and place the folder `ffmpeg-xxxxx-git-xxxxx-xxxx-static` inside **C:\ffmpeg**
- Before proceeding, check out this gif to set up `ffmpeg` PATH correctly http://i.imgur.com/aR5l1Hn.gif *(thanks to PooPeePants#7135)*
- Go to My Computer, right click and select Properties. On the left tab, select Advanced System Settings. Under the Advanced tab, select Environmental Variables near the bottom. One of the variables should be called "Path". Add a semi-colon (;) to the end followed by your FFMPEG's **bin** install location (**for example C:\ffmpeg\ffmpeg-xxxxx-git-xxxxx-xxxx-static\bin**). Save and close.
- Setup your API keys as explained above.
- Restart your computer.
[NET Framework]: https://www.microsoft.com/en-us/download/details.aspx?id=48130
[FFMPEG]: https://github.com/Soundofdarkness/FFMPEG-Installer
[7zip]: http://www.7-zip.org/download.html
[Releases]: //github.com/Kwoth/NadekoUpdater/releases/tag/v1.0
[DiscordApp]: https://discordapp.com/developers/applications/me
[Notepad++]: https://notepad-plus-plus.org/
[Invite Guide]: http://discord.kongslien.net/guide.html
[Google Console]: https://console.developers.google.com
[Soundcloud]: https://soundcloud.com/you/apps/new

View File

@ -0,0 +1,54 @@
# Docker Guide with DigitalOcean
#####Prerequisites:
- Digital ocean account (you can use my [reflink][reflink] to support the project and get 10$ after you register)
- [PuTTY][PuTTY]
- A bot account - follow this [guide][guide]
- $5
- Common sense
#####Guide
- Click on the create droplet button
![img](http://i.imgur.com/g2ayOcC.png)
- Pick one click apps and select docker on 14.04
![img](http://imgur.com/065Xkme.png)
- Pick any droplet size you want (5$ will work ok-ish on a few servers)
- Pick location closest to your discord server's location
- Pick a hostname
![img](http://imgur.com/ifPKB6p.png)
- Click create
You will get an email from DigitalOcean with your credentials now.
Open putty and type ip adress **you got in your email** with port 22
![img](http://imgur.com/Mh5ehsh.png)
- Console will open and you will be prompted for a username, type `root`.
- Type in the password you got in the email.
- Confirm the password you just typed in.
- Type in the new password.
- Confirm new password.
- When you are successfully logged in, type
`docker run --name nadeko -v /nadeko:/config uirel/nadeko`
- Wait for it to download and at one point it is going to start throwing errors due to `credentials.json` being empty
- CTRL+C to exit that
- Type `docker stop nadeko`
- Type `nano /nadeko/credentials.json` and type in your `credentials`
- CTRL+X then CTRL+Y to save
- Type `docker start nadeko`
- Type `docker logs -f nadeko` to see the console output
**Your bot is running, enjoy! o/**
*When you want to update the bot, just type `docker restart nadeko` as it always downloads latest prerelease*
[reflink]: http://m.do.co/c/46b4d3d44795/
[PuTTY]: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
[guide]: http://discord.kongslien.net/guide.html

View File

@ -0,0 +1,8 @@
###Building from Source
For easy setup and no programming knowledge, you can use [Updater](https://github.com/Kwoth/NadekoUpdater/releases/latest) or download release from [Releases](https://github.com/Kwoth/NadekoBot/releases) and follow the [Comprehensive Guide](https://github.com/Kwoth/NadekoBot/blob/master/ComprehensiveGuide.md)
In your bin/debug folder (or next to your exe if you are using release version), you must have a file called 'credentials.json' in which you will store all the necessary data to make the bot know who the owner is, and your api keys.
When you clone the project, make sure to run `git submodule init` and `git submodule update` to get the correct discord.net version
Make sure you've read ComprehensiveGuide to get a grasp of basic config/credentials setup and then look at "Credentials and config" chapter.

258
docs/guides/linuxguide.md Normal file
View File

@ -0,0 +1,258 @@
#Setting up NadekoBot on Linux
####Setting up NadekoBot on Linux Digital Ocean Droplet
######If you want Nadeko to play music for you 24/7 without having to hosting it on your PC and want to keep it cheap, reliable and convenient as possible, you can try Nadeko on Linux Digital Ocean Droplet using the link [DigitalOcean][DigitalOcean] (and using this link will be supporting Nadeko and will give you **$10 credit**)
######Keep this helpful video handy [Linux Setup Video][Linux Setup Video] (thanks to klincheR) it contains how to set up the Digital Ocean droplet aswell.
####Setting up NadekoBot
Assuming you have followed the link above to created an account in Digital Ocean and video to set up the bot until you get the `IP address and root password (in email)` to login, its time to begin.
#### Prerequisites
- Download [PuTTY][PuTTY]
- Download [CyberDuck][CyberDuck]
#### Follow these steps
- **Open PuTTY.exe** that you downloaded before, and paste or enter your `IP address` and then click **Open**.
If you entered your Droplets IP address correctly, it should show **login as:** in a newly opened window.
- Now for **login as:**, type `root` and hit enter.
- It should then, ask for password, type the `root password` you have received in your **email address registered with Digital Ocean**, then hit Enter.
*(as you are running it for the first time, it will most likely to ask you to change your root password, for that, type the "password you received through email", hit Enter, enter a "new password", hit Enter and confirm that "new password" again.*
**SAVE that new password somewhere safe not just in mind**. After you done that, you are ready to write commands.
**Copy and just paste** using **mouse right-click** (it should paste automatically)
######MONO (Source: [Mono Source][Mono Source])
**1) Installing Mono**
`sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF`
`echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list`
`sudo apt-get update`
Note if the command is not being initiated, hit **Enter**
**2)**
`echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list`
**2.5)**
*ONLY DEBIAN 8 and later*
`echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list`
**2.6)**
*ONLY CentOS 7, Fedora 19 (and later)*
`yum install yum-util`
`rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"`
`yum-config-manager --add-repo http://download.mono-project.com/repo/centos/`
**3)**
*Mono Devel*
`apt-get install mono-devel`
**Type** `y` **hit Enter**
**4)**
Opus Voice Codec
`sudo apt-get install libopus0 opus-tools`
**Type** `y` **hit Enter**
**5)**
`sudo apt-get install libopus-dev`
**In case you are having issues with Mono where you get a random string and the bot won't run, do this:**
`sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF`
`echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list`
`apt-get install ca-certificates-mono`
`mozroots --import --sync`
####FFMPEG
**6)**
`apt-get install ffmpeg`
**Type** `y` **hit Enter**
NOTE: if its "not installing" then, follow the guide here: [FFMPEG Help Guide][FFMPEG Help Guide]
**All you need to do, if you are running UBUNTU 14.04 is initiate these:**
`sudo add-apt-repository ppa:mc3man/trusty-media`
`sudo apt-get update`
`sudo apt-get dist-upgrade`
*Before executing* `sudo apt-get install ffmpeg`
**If you are running Debian 8 Jessie, please, follow these steps:**
`wget http://luxcaeli.de/installer.sh && sudo bash installer.sh` (Thanks to Eleria<3)
In case you are not able to install it with installer ^up there, follow these steps:
`sudo apt-get update`
`echo "deb http://ftp.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/debian-backports.list`
`sudo apt-get update`
`sudo apt-get install ffmpeg -y`
####Uncomplicated Firewall UFW
**7)**
`apt-get install ufw`
**it is most likely to have it already installed so if you see it is already installed, check with following command, and/or enable it**
**8)**
`ufw status`
**9)**
`ufw enable`
**Type** `y` **hit Enter**
**10)**
`sudo ufw allow ssh`
**11)**
Unzip
`apt-get install unzip`
**12)**
TMUX
`apt-get install tmux`
**Type** `y` **hit Enter**
####Importing certs
**13)**
`certmgr -ssl https://discordapp.com`
**14)**
`certmgr -ssl https://gateway.discord.gg`
Type `yes` and hit Enter **(three times - as it will ask for three times)**
**15)**
Create a new folder “nadeko” or anything you prefer
`mkdir nadeko`
**16)**
Move to “nadeko” folder (note `cd --` to go back the directory)
`cd nadeko`
####Getting NadekoBot from Releases
Go to this link: [Releases][Releases] and **copy the zip file address** of the lalest version available,
it should look like `https://github.com/Kwoth/NadekoBot/releases/download/vx.xx/NadekoBot.vx.x.zip`
**17)**
Get the correct link, type `wget`, then *paste the link*, then hit **Enter**.
`wget https://github.com/Kwoth/NadekoBot/releases/download/vx.xx/NadekoBot.vx.x.zip`
**^Do not copy-paste it**
**18)**
Now we need to `unzip` the downloaded zip file and to do that, type the file name as it showed in your screen or just copy from the screen, should be like ` NadekoBot.vx.x.zip`
`unzip NadekoBot.vx.x.zip`
**^Do not copy-paste it**
####Setting up NadekoBot
- Open **CyberDuck**
- Click on **Open Connection** (top-left corner), a new window should appear.
- You should see **FTP (File Transfer Protocol)** in drop-down.
- Change it to **SFTP (SSH File Transfer Protocol)**
- Now, in **Server:** paste or type in your `Digital Ocean Droplets IP address`, leave `Port: 22` (no need to change it)
- In **Username:** type `root`
- In **Password:** type `the new root password (you changed at the start)`
- Click on **Connect**
- It should show you the new folder you created.
- Open it.
#####MAKE SURE YOU READ THE README BEFORE PROCEEDING
- Copy the `credentials_example.json` to desktop
- EDIT it as it is guided here: [Readme][Readme]
- Rename it to `credentials.json` and paste/put it back in the folder. `(Yes, using CyberDuck)`
- You should see two files `credentials_example.json` and `credentials.json`
- Also if you already have nadeko setup and have `credentials.json`, `config.json`, `nadekobot.sqlite`, and `"permissions" folder`, you can just copy and paste it to the Droplets folder using CyberDuck.
####Running NadekoBot
Go back to **PuTTY**, `(hope its still running xD)`
**19)**
Type/ Copy and hit **Enter**.
`tmux new -s nadeko`
**^this 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 PuTTY in the background.`
`cd nadeko`
**20)**
`mono NadekoBot.exe`
**CHECK THE BOT IN DISCORD, IF EVERYTHING IS WORKING**
Now time to **move bot to background** and to do that, press **CTRL+B+D** (this will ditach the nadeko session using TMUX), and you can finally close PuTTY now.
Copy your CLIENT ID (that's in the same Developer page where you brought your token) and replace `12345678` in this link: `https://discordapp.com/oauth2/authorize?client_id=12345678&scope=bot&permissions=66186303` with it. Go to that link and you will be able to add your bot to your server.
**NOW YOU HAVE YOUR OWN NADEKO BOT** `Thanks to Kwoth <3`
####Some more Info (just in case):
-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.)
**21)**
-If you want to **kill** NadekoBot **session**, type `tmux kill-session -t nadeko`
####How to restart Nadeko with the server (for science)
**22)**
Open **PuTTY** and login as you have before, type `reboot` and hit Enter.
####Updating Nadeko
**FOLLOW THESE STEPS SERIALLY**
- **-21 OR 22**
- **-19**
- **-16**
- **-17**
- **-18**
- **-20**
HIT **CTRL+B+D** and close **PuTTY**
`IF YOU FACE ANY TROUBLE ANYWHERE IN THE GUIDE JUST FIND US IN NADEKO'S DISCORD SERVER`
[PuTTY]: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
[CyberDuck]: https://cyberduck.io
[Linux Setup Video]: https://www.youtube.com/watch?v=icV4_WPqPQk&feature=youtu.be
[Releases]: https://github.com/Kwoth/NadekoBot/releases
[Readme]: https://github.com/Kwoth/NadekoBot/blob/master/README.md
[FFMPEG Help Guide]: http://www.faqforge.com/linux/how-to-install-ffmpeg-on-ubuntu-14-04/
[Mono Source]: http://www.mono-project.com/docs/getting-started/install/linux/
[DigitalOcean]: http://m.do.co/c/46b4d3d44795/

1
docs/guides/macguide.md Normal file
View File

@ -0,0 +1 @@
##MAC Guide