- Renamed linux and windows output folders in .gitlab-ci.yml
11 KiB
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
TODO
Linux migration instructions
- In order to migrate your bot which is hosted on a 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
- Run the old installer
cd ~ && wget -N https://github.com/Kwoth/NadekoBot-BashScript/raw/1.9/linuxAIO.sh && bash linuxAIO.sh
- Run the 'download' option again
- Run the bot
- Type
.stats
and make sure the version is2.46.5
or later - Stop the bot
- Run the old installer
- Make sure your bot's folder is called
NadekoBot
- Run
cd ~ && ls
- Confirm there is a folder NadekoBot
- Run
- Run the new installer, and run the options 1, 2 and 3 in that order to successfully migrate your bot's data
- 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 (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
- You can try running
.stats
to ensure owner id is correct .lcr
to see custom reactions.lp
to list permissions
- You can try running
- 🎉 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 your bot which is hosted on a 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
- 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
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 credentials file
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
- .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), 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 (todo: WIP)
Open powershell and run following commands:
- Navigate to your bot's folder, for example
cd ~/Desktop/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 (changes to .cs files) 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-build the bot
dotnet publish -c Release -o output/ src/NadekoBot/
- Run the bot
cd output && dotnet NadekoBot.dll
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, then just move theffmpeg.exe
file to nadekobot/output - youtube-dl - Click to download the file. Then put
youtube-dl.exe
in a path that's in your PATH environment variable. If you don't know what that is, then just move theyoutube-dl.exe
file to NadekoBot/system
Linux From Source
Open Terminal (if you're on a linux with 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 here nano nadekobot/output/creds.yml
- Enter your bot's token
- After you're done, you can close nano (and save the file) by typing
- CTRL+X
- Type
y
- Press Enter
- After you're done, you can close nano (and save the file) by typing
- Run the bot (type
3
and press enter)
Update Instructions
- ⚠ Stop the bot
- Download 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" and download it
- Untar it
tar xf 2.99.8-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 typing
- CTRL+X
- Type
y
- Press
Enter
- After you're done, you can close nano (and save the file) by typing
- 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" and download it
- Untar it
tar xf 2.99.8-linux-x64-build.tar
- Rename the old nadekobot directory to nadekobot-old (first remove old backup if you had 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 updated version of those files
⚠ If you've modified these 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 NadekoBot executable
cd nadekobot && chmod +x NadekoBot
- Run the bot
./NadekoBot
🎉 Enjoy
Steps 2 - 9 as a single command
tar xf 2.99.8-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 (it's your app's name) - 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 Token to
creds.yml
- 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 previously 🎉