Setting Up NadekoBot from Source¶
Build NadekoBot from its source code. Use this guide if you want to change the code. For a normal install, use the desktop guide, the CLI guide or the Docker guide.
Before you start¶
- Create a Discord bot and copy its token.
- Install the .NET 9 SDK.
- Install Git.
- Install a text editor, for example Visual Studio Code.
Install the bot¶
Open a terminal: PowerShell on Windows, Terminal on Linux and macOS. The commands are the same on all three systems.
-
Go to the folder for the bot, for example your home folder:
cd ~ -
Download the source code and go to the bot project:
git clone https://github.com/nadeko-bot/nadekobot -b v6 --depth 1 cd nadekobot/src/NadekoBot -
Make the credentials file:
cp data/creds_example.yml data/creds.yml -
Open
data/creds.ymlin your text editor. Put your token between the quotes of thetokenfield, then save the file. -
Build and start the bot:
dotnet run -c Release
The bot comes online in your server. It uses the files in src/NadekoBot/data.
Install the music tools¶
For music, the bot needs ffmpeg, yt-dlp and Deno in your PATH.
winget install Gyan.FFmpeg
winget install yt-dlp.yt-dlp
winget install DenoLand.Deno
Then close PowerShell and open it again. If music does not play, install the latest Microsoft Visual C++ Redistributable (x64).
sudo apt update
sudo apt install ffmpeg curl unzip
mkdir -p ~/.local/bin
curl -L -o ~/.local/bin/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux
chmod +x ~/.local/bin/yt-dlp
curl -fsSL https://deno.land/install.sh | sh
On Fedora, use sudo dnf install ffmpeg-free unzip. On other systems, install ffmpeg with your package manager. Make sure that ~/.local/bin is in your PATH.
The voice files in data/lib are for x64 only. On an ARM computer, music does not work.
brew install ffmpeg yt-dlp deno
Music does not work on macOS yet, because the bot has no macOS voice files in data/lib.
Update the bot¶
- Stop the bot: press Ctrl+C, or type
.diein Discord. -
Make a copy of the
datafolder:cd ~/nadekobot/src/NadekoBot cp -r data ~/nadeko-data-backupIf
~/nadeko-data-backupexists, delete it first. -
Download the new code:
git pull --autostash -
Start the bot:
dotnet run -c Release
--autostash keeps the changes which the bot made in its config files. If Git shows refusing to merge unrelated histories, clone the bot again and copy your data folder from ~/nadeko-data-backup into src/NadekoBot/data. If Git shows a different conflict, ask in the NadekoBot Discord server.