Installation Guide For Windows - UnforeseenOcean/WildBeast GitHub Wiki
Welcome to the installation guide for WildBeast on Windows! In this guide, we'll walk you through the installation and deployment process for the WildBeast bot. ##Prerequisites
- Windows system
- Most Windows systems can run this bot fine, unless you have a really low-end laptop.
- OS: Windows 7 and up
- Administrator access to the computer
- Programs
##Installation General note: Quite a few steps in this guide will be using administrative permissions. Therefore we recommend that you are logged into an administrator account to not have to type the admin password every time you perform something. ####Installing Node Go to the NodeJS download page and download the version relevant to your OS bit version.
It's pretty straight forward, just make sure that the features tab looks like this.
When that's installed, it's time to retrieve the WB repository.
####Installing Git and retrieving WildBeast
Next we'll install Git to be able to download WildBeast.
Start off by going to the Git download page and download the Windows installer.
NOTE: The installation process of Git has to go exactly as described below, otherwise you will have to take longer ways around!
Once downloaded, run the installer. Read the license and continue. Once you get to the component selection, make sure that it looks at least like this!
After selecting the start menu folder, this is where things get precise. Make sure that you tick the boxes exactly as follows!
And in text:
Use Git from Git Bash only
(In Adjusting your PATH environment)
Checkout Windows-style, commit Unix-style endings
(In Configure the line ending conversions)
Use OpenSSH
(In Choosing the SSH executable)
Use MinTTY (the default terminal MSYS2)
(In Configuring the terminal emulator to use with Git Bash)
When you've gotten that straight, you've set up Git in the way we intend to use it!
Next, we'll retrieve the WildBeast GitHub repository, or clone in Git terms. This means that we download the bot using the Git SCM system. Now, you might ask: Why are we doing this? Can't I just download a ZIP package? The answer is: No. We're making it easier for you in the future to update WildBeast, just follow along for now.
You'd want to figure out where you want the bot to be downloaded. Something simple like the root of the C:\ drive (Possibly some other drive, though NOT A FLASH DRIVE) or optionally your Desktop could be fine.
When you've found the location of your choice, hit Shift+Right click and select Git Bash here
. This will open the Git Bash console.
Type the following command into Git Bash:
git clone https://github.com/TheSharks/WildBeast.git -b master
Let it clone the Git repository. When it's done, you should have the following output.
NOTE: If you get any errors, see the FAQ before asking questions! (FILL IN THE LINK STILL)
Now, why did we do it this way? The reason is simple: Ease of updating. If we make a commit to the repository (Smaller update), you can apply that update to your bot in seconds without having to redo anything. If you downloaded a ZIP package, you would have to redownload the entire ZIP package again before it's updated! That is the reason to why we use Git to download WildBeast.
You have now successfully cloned the WildBeast Git repository! ####Installing the Node dependencies
Now it's time to install the Node dependencies for the bot. These are smaller packages that WildBeast relies on to run. Open a command prompt in the WildBeast folder (Shift+Right click) and select "Open command window here". This will open a command window. Next, type in the following command into the command prompt:
npm install
This will download the dependencies. Wait until it completes, and when you are able to execute commands again the install has completed. The output is too huge to provide an image of, so you'll have to do without.
If you get errors that say WARN
and yellow text, you can ignore those. If you however start getting red text, there might be a problem installing. Check that the WildBeast directory does not require admin permissions to execute stuff in. You may come and ask us over at WildBot's Territory if you need help debugging these errors.
##Configuration
Find config.example.json
on your PC and open it using Notepad++ or any other code editor. Do not edit it with Windows Notepad, that will be a mess.
###The config file
When opening the config file, you should have a file that looks like this. (The CSE is deprecated and likely to be removed, but the others are still needed)
We'll now walk you through the different sections in the config and what they do.
####Bot section
Property | Explanation | Notes |
---|---|---|
isbot | If an OAuth bot account should be used. | Recommended to be true due to Discord bot rules. |
token | OAuth token for the bot. | Refer to the "Making the config" section. |
Email for normal user account that the bot will use. | DO NOT input your personal login details here. | |
password | Password for the account mentioned above. | As above. |
oauth | The OAuth URL for the bot. | Refer to the "Making the config" section. |
####Settings section | ||
Property | Explanation | Notes |
-------- | ----------- | ----- |
prefix | The command prefix the bot will use. | Can be a special character like / etc. |
####Permissions section | ||
Property | Explanation | Notes |
-------- | ----------- | ----- |
master | The highest possible access level of 9. Full permissions. | Only give this to yourself and maybe others you really trust. |
level1, level2, level3 | Settable access levels that give users access to certain commands. | Default access levels can be found in the command files. |
Notice: By default, when WildBeast joins a server it will set the owner's access level to 5. This is to give them control over normal users. | ||
####API keys section | ||
Property | Explanation | Notes |
-------- | ----------- | ----- |
imgflip | Your imgflip login details. | Used in certain meme commands. |
For retrieving data from YouTube. | Refer to the "Making the config" section. | |
mashape | For retrieving the Fortune Cow. | Refer to the "Making the config" section. |
cse | Deprecated and not required, don't bother with this. | This will be removed at some point. |
###Making the config |
- OAuth app
- We'll start off by creating an OAuth application in Discord's developer interface so that the bot can login.
- Go to https://discord.com/developers/applications/me and create a new application.
- Name it whatever you prefer and give it a fancy picture. Fill in a description if you want to, then click "Create application".
- Now you'll have a more full-fledged app page. Click "Add Bot User" and confirm to make it a bot.
- Here you'll get a Client ID and a token. Reveal the token (Not the secret) and replace "Bot token" with that in the config.
- If you completed the step above and want to comply with Discord rules, skip the email/password section and leave them be.
- Next we'll make an OAuth URL for the bot so it can be added to the server.
- Just put this placeholder URL somewhere for now, don't open it as it will not work.
https://discord.com/oauth2/authorize?&client_id=CLIENTID&scope=bot&permissions=536345655
- Go back to the app page, and copy the Client ID.
- Replace the
CLIENTID
placeholder in the URL above with the ID you just copied. You can open the URL to test that you did it right. - If the URL works as intended, copy it and replace "URL" in the config with the one you copied.
- You can also open the URL and add your bot to the server at this point, so you don't forget it. It will have the permissions it wants precalculated due to the number after the
permissions
property. Just select your server from the dropdown list and add it. The bot won't do anything at this stage because we're not finished yet. - If you can't select your server, it might be that you lack Manage Server permissions.
- Just put this placeholder URL somewhere for now, don't open it as it will not work.
- We'll start off by creating an OAuth application in Discord's developer interface so that the bot can login.
- Prefix
- Setting the command prefix isn't really rocket science. This can be any special character, for instance
/
,?
and so forth. - You can also use multiple characters as a prefix, for instance
!!
and++
. - Note that there is always a so-called global prefix: A mention. Saying
@BotName
in chat will function as a prefix as well. This doesn't need to be specified in the config as it's always active.
- Setting the command prefix isn't really rocket science. This can be any special character, for instance
- Permissions
- This is a section that has a very interesting gimmick to it.
- WildBeast has a command named
setlevel
which will set the level of a user. However, that is written into a server-specific config. Which means that if you set the level of someone to 2 in Server1, they will not be level 2 in Server2, for example. - The permissions fields here are so-called global permissions, and will apply unless a server-specific level is set.
- Use this to add technicians and others who need permissions regardless of where the bot is.
- WildBeast has a command named
- You can specify users here by adding their IDs into the fields. Only the master field is mandatory.
- You can get the ID of a user by either "backlash mentioning" them, which means to say typing
\@User
in chat or by enabling Developer Mode (Personal Settings -> Appearance -> Enable Developer Mode) and right-clicking on someone, subsequently selecting Copy ID from the list and pasting it in between the quotes. - Remember to follow the example syntax in the master field when adding multiple users!
- You can get the ID of a user by either "backlash mentioning" them, which means to say typing
- This is a section that has a very interesting gimmick to it.
- API keys
- General notice: Anything within these fields is sensitive and could do much harm if revealed to the public.
- Therefore it is imperative that you keep this to yourself.
- WildBeast maintainers will NEVER ask for your login details or API keys. Only show the config to trusted WildBeast maintainers with the
Staff
role in WildBot's Territory.
- imgflip
- The procedure for getting this isn't tricky. Just go to https://imgflip.com, create an account and input your username and password into the fields.
- Google
- This API is used to retrieve data from YouTube, related to music playback.
- Go to https://console.developers.google.com and create a new project. Name it whatever you fancy. Nothing else needs to be changed unless you want to change the project ID or the app engine location.
- Wait a while as the project is being created.
- When the creation process is completed, you'll get taken to the screen below. Click "YouTube Data API" as highlighted below.
- When the API page opens, click the "Enable" button in the top bar. Then you will get a warning saying that you need to create creditentials. That's exactly what we will do.
- Click the "Go to creditentials" button. In the next dropdowns, make them look like following.
- Hit "What creditentials do I need?" and the page will generate a Google API key for you. Copy the API key and replace the "A google key" placeholder with that key in the config.
- This API is used to retrieve data from YouTube, related to music playback.
- Mashape
- This API is used with the
fortunecow
command.
- Go to the Mashape site and login as you prefer, GitHub login is supported.
- Navigate to the Mashape APIs dashboard and add a new application. Name it as you wish.
- Once the app is created, click "Add API to your application" and search for
fortunecow
. - Open the fortunecow API page and in one of the dropdowns on the left, change it to the application you just created and hit "Test Endpoint" on any you wish to test. Only one is required.
- This will add the API to your application. Navigate back to the dashboard and click on the app itself. It should now have an appearance that resembles to this.
- Hit "Get the keys" in the top-right corner. In the drop-down menu that is opened, select "Production". This will be your Mashape API key for that application. Copy that and replace the "A mashape key" placeholder in the config with that key.
- This API is used with the
- CSE
- This option isn't required anymore and can safely be left alone. If you really want to get one you can, but it won't do anything and you'll have to do that yourself.
- Twitch
- This API is used with the
twitch
command. This will be the client ID the bot passes to Twitch when retrieving stream status.- Go to the Twitch Connections page, scroll down to the bottom and click "Register new application".
- Fill in the fields. Name should be your app name, and set the Redirect URI to
http://localhost
unless you want something to function differently. Set the app type to "Chat Bot" as that's what you're basically doing here. - Click "Register". This will take you to the application management page. Down towards the bottom, there will be a section saying "Client ID".
- Copy that character sequence and replace the "A twitch Client-ID" placeholder in the config with that ID.
- This API is used with the
- General notice: Anything within these fields is sensitive and could do much harm if revealed to the public.
That's all, your config should now be ready to rock! Save it as config.json
(NOT config.example.json
as the bot will error if you do. TLDR: Don't hit Ctrl+S, hit Ctrl+Alt+S).
##Running the bot Congratulations, your WildBeast instance should be ready to launch!
To test if you've done everything correctly, you can do a "test run" with the bot. This means not making it permanently available, just testing if any errors are spat out when running.
Open a command window in the WildBeast folder (Shift+Right click and select Open command window here)
node DougBot.js --noinitial
The noinitial parameter will skip the configuration process via the console (As you already did that manually in the previous step) and skip straight to running.
If the bot runs without any errors, you have had success so far!
You can test simple functionality by running the ping
command (With your desired prefix) in a text channel that the bot can see. If it answers "Pong!", then congratulations, you have successfully set up WildBeast!
Remember to keep the command window open, otherwise the bot will stop running! When you want to stop it, just close the command window.
###And that's it! You are now ready to start using your very own WildBeast instance! Keep in mind, if you have further questions or need help, we're around over at our official server! Link below.
On the behalf of the WildBeast team, we hope you enjoy your bot!