It took so long after the last mention since I was too stubborn to just do this from a local git client for too long. Linux and OS X guides both have things built one by one for now and I'll only re-release the windows updater once I get the A-OK for not having to build things one by one.
7.3 KiB
Setting Up NadekoBot on OSX
Prerequisites
-
- Google Account
-
- Soundcloud Account (if you want soundcloud support)
-
- Text Editor (TextWrangler, or equivalent) or outside editor such as Atom
####Installing Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Run brew update to fetch the latest package data.
####Installing dependencies
brew install git
brew install ffmpeg
brew update && brew upgrade ffmpeg
brew install openssl
brew install opus
brew install opus-tools
brew install opusfile
brew install libffi
brew install libsodium
brew install tmux
####Installing .NET Core SDK
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/- Download the .NET Core SDK, found here.
- Open the
.pkgand install it.
####Check your FFMPEG
In case your FFMPEG wasnt installed properly
brew options ffmpegbrew install ffmpeg --with-x --with-y --with-zetc.brew update && brew upgrade(Update formulae and Homebrew itself && Install newer versions of outdated packages)brew prune(Remove dead symlinks from Homebrew’s prefix)brew doctor(Check your Homebrew installation for common issues)- Then try
brew install ffmpegagain.
####Installing xcode-select Xcode command line tools. You will do this in Terminal.app by running the following command line:
xcode-select --install
A dialog box will open asking if you want to install xcode-select. Select install and finish the installation.
####Downloading and building Nadeko
cd ~git clone -b 1.0 --recursive https://github.com/Kwoth/NadekoBot.gitcd /NadekoBot/discord.net/src/Discord.Netdotnet restore && dotnet build --configuration Releasecd ../Discord.Net.Commands/dotnet restore && dotnet build --configuration Releasecd ../../../src/NadekoBot/dotnet restore && dotnet build --configuration Releasedotnet run --configuration Release- The above step will crash, giving you an error, which will say that
credentials_example.jsonhas been generated, we'll use this soon
####Creating DiscordBot application
- Go to the Discord developer application page.
- 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.
- Click on
Create a Bot Userand confirm it. - Keep this window open for now.
####Setting up Credentials.json file
- Open up the
NadekoBotfolder, which should be in your home directory, then thesrcfolder and then the additonalNadekoBotfolder. - In our
NadekoBotfolder you should have.jsonfile namedcredentials_example.json. (Note: If you do not see a .json aftercredentials_example.json, do not add the**.json**. You most likely have"Hide file extensions"enabled.) - Rename
credentials_example.jsontocredentials.json. - Open the file with your Text editor.
- In your applications page (the window you were asked to keep open earlier), under the
Bot Usersection, you will seeToken:click to reveal, click to reveal the token. - Copy your bot's token, and on the
"Token"line of yourcredentials.json, replacenullwith your bot token and put quotation marks before and after the token, like so"Example.Token" - Copy the
Client IDon the page and replace the null part of theClientIdline with it, and put quotation marks before and after, like earlier. - Again, copy the same
Client IDand replace the null part of theBotIdline with it, and do not put quotation marks before and after the ID. - Save your
credentials.jsonbut keep it open. We need to add yourUser IDas one of theOwnerIdsshortly.
####Running NadekoBot
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).
or if you want to use Screen, run:
screen -S nadeko
^this will create a new screen named “nadeko”
(you can replace “nadeko” with anything you prefer and remember its your screen name).
cd ~/NadekoBot/src/NadekoBot/
- Start Nadeko using dotnet:
dotnet run --configuration Release
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)
If you used Screen press CTRL+A+D (this will detach the nadeko screen)
####Inviting your bot to your server - Invite Guide
- Create a new server in Discord.
- Copy your
Client IDfrom your Discord bot applications page. - Replace the
12345678in this linkhttps://discordapp.com/oauth2/authorize?client_id=12345678&scope=bot&permissions=66186303with yourClient ID. - Your edited 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.
####Setting up OwnerIds
- In the server where your bot is, in a text channel, type
.uid - Your
User IDshould show, copy it. - Stop NadekoBot from running by presing
Ctrl + Cin the terminal that the bot is running in - Replace the
nullsection on theOwnerIdsline with your user ID shown earlier and put a square bracket around each end of the ID like so,[105635576866156544] - Run Nadeko again, as guided above.
- If done correctly, you are now the bot owner.
- You can add multiple owner IDs by seperating them with a comma within the square brackets.
####Setting NadekoBot Music
For Music Setup and API keys check Setting up NadekoBot for Music and JSON Explanations.
####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
####Some more Info - 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
####Some more Info - Screen
- If you want to see the sessions after logging back again, type
screen -ls, and that will give you the list of screens. - 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