.gitlab | ||
docs | ||
src | ||
.dockerignore | ||
.gitignore | ||
.gitlab-ci.yml | ||
CHANGELOG.md | ||
Dockerfile | ||
exe_builder.iss | ||
LICENSE.md | ||
mkdocs-requirements.txt | ||
mkdocs.yml | ||
NadekoBot.sln | ||
NuGet.Config | ||
README.md | ||
release.ps1 |
Migration from 2.x
⚠ If you're already hosting NadekoBot, You MUST update to latest version of 2.x and run your bot at least once before switching over to v3.
Windows migration instructions
- Run your NadekoBot Updater first, and make sure your bot is updated to at least 2.46.5
- Get the new NadekoBot Updater here
- Click on the + icon to add a new bot
- Next to the path, click on the folder icon and select the folder where your 2.46.5 bot is
- ℹ In case you're not sure where it's located, you can open your old updater and see it
- If you've selected the correct path, you should have an Update button available, click it
- You're done; you can now run your bot, and you can uninstall your old updater if you no longer have 2.x bots
- 🎉
Linux migration instructions
- In order to migrate a bot hosted on Linux, first update your current version to the latest 2.x version using the 2.x installer, run the bot, and make sure it works. Then:
- Run the old installer with
cd ~ && wget -N https://github.com/Kwoth/NadekoBot-BashScript/raw/1.9/linuxAIO.sh && bash linuxAIO.sh
- Run option 1 again
- Run the bot
- Type
.stats
and ensure the version is2.46.5
or later - Stop the bot
- Run the old installer with
- Make sure your bot's folder is called
NadekoBot
- Run
cd ~ && ls
- Confirm there is a folder NadekoBot
- Run
- Migrate your bot's data using the new installer:
- Run the new installer
cd ~ && wget -N https://gitlab.com/Kwoth/nadeko-bash-installer/-/raw/master/linuxAIO.sh && bash linuxAIO.sh
- The installer should notify you that your data is ready for migration in a message above the menu
- Install prerequisites (type
1
and press enter), and make sure it is successful - Download NadekoBot v3 (type
2
and press enter) - Run the bot (type
3
and press enter)
- Run the new installer
- Make sure your permissions, custom reactions, credentials, and other data is preserved
.stats
to ensure owner id (credentials) is correct.lcr
to see custom reactions.lp
to list permissions
- 🎉 Enjoy. If you want to learn how to update the bot, click (here)[#linux-updating-the-bot].
Manual migration
⚠ NOT RECOMMENDED
⚠ NadekoBot v3 requires .net 5
- In order to migrate a bot hosted on Linux or from source on Windows, first update your current version to the latest 2.x version using the 2.x installer, run the bot, and make sure it works. Then:
- Rename your old nadeko bot folder to
nadekobot_2x
mv NadekoBot nadekobot_2x
- Build the new version and move old data to the output folder
- Clone the v3 branch to a separate folder
git clone https://gitlab.com/kwoth/nadekobot -b v3 --depth 1
- Build the bot
dotnet publish -c Release -o output/ src/NadekoBot/
- Copy old data
- ⚠ Be sure you copy the correct command for your system!
- Windows:
cp -r -fo nadekobot_2x/src/NadekoBot/data nadekobot/src/NadekoBot/data
- Linux:
cp -rf nadekobot_2x/src/NadekoBot/data nadekobot/src/NadekoBot/data
- Copy the database
cp nadekobot_2x/src/NadekoBot/bin/Release/netcoreapp2.1/data/NadekoBot.db nadekobot/output/data
- Copy your credentials
cp nadekobot_2x/src/NadekoBot/credentials.json nadekobot/output/
- Clone the v3 branch to a separate folder
- Run the bot
cd nadekobot/output
dotnet NadekoBot.dll
- That's it. Just make sure that when you're updating the bot, you're properly backing up your old data.
Fresh Installation
Windows From Source
Prerequisites
Install these before proceeding or your bot will not work!
- .net 5 - needed to compile and run the bot
- git - needed to clone the repository (you can also download the zip manually and extract it, but this guide assumes you're using git)
- redis - to cache things needed by some features and persist through restarts
Installation Instructions
Open PowerShell (press windows button on your keyboard and type powershell, it should show up; alternatively, right click the start menu and select Windows PowerShell), and navigate to the location where you want to install the bot (for example cd ~/Desktop/
)
git clone https://gitlab.com/kwoth/nadekobot -b v3 --depth 1
dotnet publish -c Release -o output/ src/NadekoBot/
cd output && cp creds_example.yml creds.yml
- Open
creds.yml
with your favorite text editor (Please don't use Notepad or WordPad. You can use Notepad++, VSCode, Atom, Sublime, or something similar) - Enter your bot's token
- Run the bot
dotnet NadekoBot.dll
- 🎉
Update Instructions
Open PowerShell as described above and run the following commands:
- Navigate to your bot's folder, for example
cd ~/Desktop/nadekobot/src/NadekoBot
- Pull the latest updates (this will fail if you have custom code changes).
- If you don't have custom code changes, just run
git pull
- If you do have custom code changes, You have 3 options
- Undo all changes with
git checkout -- * && git pull
- Stash changes and try to re-apply them
git stash && git pull && git stash apply
- Commit your changes and resolve merge conflicts
git add . && git commit -m "My commit message" && git pull
- Undo all changes with
- If you don't have custom code changes, just run
- Re-run the bot
dotnet run -c Release
⚠ You're expected to understand that your database will be in bin/Release/<framework>/data/
, and if <framework>
gets changed in the future, you will have to move your database manually.
Music prerequisites
In order to use music commands, you need ffmpeg and youtube-dl installed.
- ffmpeg-32bit | ffmpeg-64bit - Download the appropriate version for your system (32 bit if you're running a 32 bit OS, or 64 if you're running a 64bit OS). Unzip it, and move
ffmpeg.exe
to a path that's in your PATH environment variable. If you don't know what that is, just move theffmpeg.exe
file toNadekoBot/output
. - youtube-dl - Click to download the file, then move
youtube-dl.exe
to a path that's in your PATH environment variable. If you don't know what that is, just move theyoutube-dl.exe
file toNadekoBot/system
.
Linux From Source
Open Terminal (if you're on an installation with a window manager) and navigate to the location where you want to install the bot (for example cd ~
)
Installation Instructions
- Download and run the new installer script
cd ~ && wget -N https://gitlab.com/Kwoth/nadeko-bash-installer/-/raw/master/linuxAIO.sh && bash linuxAIO.sh
- Install prerequisites (type
1
and press enter) - Download the bot (type
2
and press enter) - Exit the installer in order to set up your
creds.yml
- Copy the creds.yml template
cp nadekobot/output/creds_example.yml nadekobot/output/creds.yml
- Open
nadekobot/output/creds.yml
with your favorite text editor. We will use nano herenano nadekobot/output/creds.yml
- Enter your bot's token
- After you're done, you can close nano (and save the file) by inputting, in order
CTRL
+X
Y
Enter
- After you're done, you can close nano (and save the file) by inputting, in order
- Run the bot (type
3
and press enter)
Update Instructions
- ⚠ Stop the bot
- Update and run the new installer script
cd ~ && wget -N https://gitlab.com/Kwoth/nadeko-bash-installer/-/raw/master/linuxAIO.sh && bash linuxAIO.sh
- Update the bot (type
2
and press enter) - Run the bot (type
3
and press enter) - 🎉
Linux Release
Installation Instructions
- Download the latest release from https://gitlab.com/Kwoth/nadekobot/-/releases
- Look for the file called "X.XX.X-linux-x64-build.tar" (where X.XX.X is a series of numbers) and download it
- Untar it
⚠ Make sure that you change X.XX.X to the same series of numbers as in step 1!
tar xf X.XX.X-linux-x64-build.tar
- Rename the
nadekobot-linux-x64
tonadekobot
mv nadekobot-linux-x64 nadekobot
- Move into nadekobot directory and make NadekoBot executable
cd nadekobot && chmod +x NadekoBot
- Copy the creds.yml template
cp creds_example.yml creds.yml
- Open
creds.yml
with your favorite text editor. We will use nano herenano nadekobot/output/creds.yml
- Enter your bot's token
- After you're done, you can close nano (and save the file) by inputting, in order
CTRL
+X
Y
Enter
- After you're done, you can close nano (and save the file) by inputting, in order
- Run the bot
./NadekoBot
Update Instructions
- Stop the bot
- Download the latest release from https://gitlab.com/Kwoth/nadekobot/-/releases
- Look for the file called "X.XX.X-linux-x64-build.tar" (where X.XX.X is a series of numbers) and download it
- Untar it
⚠ Make sure that you change X.XX.X to the same series of numbers as in step 2!
tar xf 2.99.8-linux-x64-build.tar
- Rename the old nadekobot directory to nadekobot-old (remove your old backup first if you have one, or back it up under a different name)
rm -rf nadekobot-old 2>/dev/null
mv nadekobot nadekobot-old
- Rename the new nadekobot directory to nadekobot
mv nadekobot-linux-x64 nadekobot
- Remove old strings and aliases to avoid overwriting the updated versions of those files
⚠ If you've modified said files, back them up insteadrm nadekobot-old/data/aliases.yml
rm -r nadekobot-old/data/strings
- Copy old data
cp -RT nadekobot-old/data/ nadekobot/data/
- Copy creds.yml
cp nadekobot-old/creds.yml nadekobot/
- Move into nadekobot directory and make the NadekoBot executable
cd nadekobot && chmod +x NadekoBot
- Run the bot
./NadekoBot
🎉 Enjoy
Steps 3 - 9 as a single command
Don't forget to change X.XX.X to match step 2.
tar xf X.XX.X-linux-x64-build.tar && \
rm -rf nadekobot-old 2>/dev/null && \
mv nadekobot nadekobot-old && \
mv nadekobot-linux-x64 nadekobot && \
rm nadekobot-old/data/aliases.yml && \
rm -r nadekobot-old/data/strings && \
cp -RT nadekobot-old/data/ nadekobot/data/ && \
cp nadekobot-old/creds.yml nadekobot/ && \
cd nadekobot && chmod +x NadekoBot
Creds Guide
This document aims to guide you through the process of creating a Discord account for your bot (the Discord Bot application), and inviting that account into your Discord server.
- Go to the Discord developer application page.
- Log in with your Discord account.
- Click New Application.
- Fill out the
Name
field however you like. - Go to the Bot tab on the left sidebar.
- Click on the
Add a Bot
button and confirm that you do want to add a bot to this app. - Optional: Add bot's avatar and description.
- Copy your Token to
creds.yml
as shown above. - Scroll down to the
Privileged Gateway Intents
section and enable both intents. These are required for a number of features to function properly, and should both be on.
Inviting your bot to your server
- On the General Information tab, copy your
Application ID
from your applications page. - Replace the
YOUR_CLIENT_ID_HERE
in this link:https://discordapp.com/oauth2/authorize?client_id=YOUR_CLIENT_ID_HERE&scope=bot&permissions=66186303
with yourClient ID
- The link should now look something like this:
https://discordapp.com/oauth2/authorize?client_id=123123123123&scope=bot&permissions=66186303
- Access that newly created link, pick your Discord server, click
Authorize
and confirm with the captcha at the end - The bot should now be in your server
That's it! You may now go back to the installation guide you were following before 🎉