Skip to content

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

Install the bot

Open a terminal: PowerShell on Windows, Terminal on Linux and macOS. The commands are the same on all three systems.

  1. Go to the folder for the bot, for example your home folder:

    cd ~
    
  2. 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
    
  3. Make the credentials file:

    cp data/creds_example.yml data/creds.yml
    
  4. Open data/creds.yml in your text editor. Put your token between the quotes of the token field, then save the file.

  5. 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

  1. Stop the bot: press Ctrl+C, or type .die in Discord.
  2. Make a copy of the data folder:

    cd ~/nadekobot/src/NadekoBot
    cp -r data ~/nadeko-data-backup
    

    If ~/nadeko-data-backup exists, delete it first.

  3. Download the new code:

    git pull --autostash
    
  4. 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.