diff --git a/docs/.gitbook/assets/afbeelding (1).png b/docs/.gitbook/assets/afbeelding (1).png new file mode 100644 index 000000000..da15f2a2d Binary files /dev/null and b/docs/.gitbook/assets/afbeelding (1).png differ diff --git a/docs/.gitbook/assets/afbeelding (10).png b/docs/.gitbook/assets/afbeelding (10).png new file mode 100644 index 000000000..5ccb37ca5 Binary files /dev/null and b/docs/.gitbook/assets/afbeelding (10).png differ diff --git a/docs/.gitbook/assets/afbeelding (11).png b/docs/.gitbook/assets/afbeelding (11).png new file mode 100644 index 000000000..f013021ba Binary files /dev/null and b/docs/.gitbook/assets/afbeelding (11).png differ diff --git a/docs/.gitbook/assets/afbeelding (2).png b/docs/.gitbook/assets/afbeelding (2).png new file mode 100644 index 000000000..cfd9689bb Binary files /dev/null and b/docs/.gitbook/assets/afbeelding (2).png differ diff --git a/docs/.gitbook/assets/afbeelding (3).png b/docs/.gitbook/assets/afbeelding (3).png new file mode 100644 index 000000000..ab66432c7 Binary files /dev/null and b/docs/.gitbook/assets/afbeelding (3).png differ diff --git a/docs/.gitbook/assets/afbeelding (4).png b/docs/.gitbook/assets/afbeelding (4).png new file mode 100644 index 000000000..9010686f4 Binary files /dev/null and b/docs/.gitbook/assets/afbeelding (4).png differ diff --git a/docs/.gitbook/assets/afbeelding (5).png b/docs/.gitbook/assets/afbeelding (5).png new file mode 100644 index 000000000..da15f2a2d Binary files /dev/null and b/docs/.gitbook/assets/afbeelding (5).png differ diff --git a/docs/.gitbook/assets/afbeelding (6).png b/docs/.gitbook/assets/afbeelding (6).png new file mode 100644 index 000000000..45b7f41fd Binary files /dev/null and b/docs/.gitbook/assets/afbeelding (6).png differ diff --git a/docs/.gitbook/assets/afbeelding (7).png b/docs/.gitbook/assets/afbeelding (7).png new file mode 100644 index 000000000..614cb3776 Binary files /dev/null and b/docs/.gitbook/assets/afbeelding (7).png differ diff --git a/docs/.gitbook/assets/afbeelding (8).png b/docs/.gitbook/assets/afbeelding (8).png new file mode 100644 index 000000000..cfd9689bb Binary files /dev/null and b/docs/.gitbook/assets/afbeelding (8).png differ diff --git a/docs/.gitbook/assets/afbeelding (9).png b/docs/.gitbook/assets/afbeelding (9).png new file mode 100644 index 000000000..45b7f41fd Binary files /dev/null and b/docs/.gitbook/assets/afbeelding (9).png differ diff --git a/docs/.gitbook/assets/afbeelding.png b/docs/.gitbook/assets/afbeelding.png new file mode 100644 index 000000000..063f0fcd8 Binary files /dev/null and b/docs/.gitbook/assets/afbeelding.png differ diff --git a/docs/.gitbook/assets/image (1).png b/docs/.gitbook/assets/image (1).png new file mode 100644 index 000000000..3187c03dc Binary files /dev/null and b/docs/.gitbook/assets/image (1).png differ diff --git a/docs/.gitbook/assets/image (2).png b/docs/.gitbook/assets/image (2).png new file mode 100644 index 000000000..3187c03dc Binary files /dev/null and b/docs/.gitbook/assets/image (2).png differ diff --git a/docs/.gitbook/assets/image (3).png b/docs/.gitbook/assets/image (3).png new file mode 100644 index 000000000..7bcb55e4d Binary files /dev/null and b/docs/.gitbook/assets/image (3).png differ diff --git a/docs/.gitbook/assets/image (4).png b/docs/.gitbook/assets/image (4).png new file mode 100644 index 000000000..91fae7142 Binary files /dev/null and b/docs/.gitbook/assets/image (4).png differ diff --git a/docs/.gitbook/assets/image (5).png b/docs/.gitbook/assets/image (5).png new file mode 100644 index 000000000..c9ec0b8f4 Binary files /dev/null and b/docs/.gitbook/assets/image (5).png differ diff --git a/docs/.gitbook/assets/image (6).png b/docs/.gitbook/assets/image (6).png new file mode 100644 index 000000000..91fae7142 Binary files /dev/null and b/docs/.gitbook/assets/image (6).png differ diff --git a/docs/.gitbook/assets/image.png b/docs/.gitbook/assets/image.png new file mode 100644 index 000000000..82d32f859 Binary files /dev/null and b/docs/.gitbook/assets/image.png differ diff --git a/docs/.gitbook/assets/wildebeest1.png b/docs/.gitbook/assets/wildebeest1.png new file mode 100644 index 000000000..85cc6e29a Binary files /dev/null and b/docs/.gitbook/assets/wildebeest1.png differ diff --git a/docs/.gitbook/assets/wildebeest2.png b/docs/.gitbook/assets/wildebeest2.png new file mode 100644 index 000000000..12ea6f9fe Binary files /dev/null and b/docs/.gitbook/assets/wildebeest2.png differ diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000..9dac68dce --- /dev/null +++ b/docs/README.md @@ -0,0 +1,33 @@ +# What is WildBeast? + +WildBeast is a wheels-attached Discord bot - meaning the heavy lifting is already done for you, making WildBeast easy to modify and extend to perfectly fit your use case. + +This documentation focusses on self-hosting and extending WildBeast. If you don't feel like hosting your own instance, we host a publicly available version of WildBeast known as [WildBot](https://invite.thesharks.xyz) which you can invite to your own server. + +## Getting Started + +Ready to get your hands dirty? Pick one of these guides to get started with WildBeast. + +{% content-ref url="guides/linux-guides/" %} +[linux-guides](guides/linux-guides/) +{% endcontent-ref %} + +### Fundamentals: Dive a little deeper + +Looking to write your own commands, or other custom features? Look below for our advanced guides. + +{% content-ref url="fundamentals/commands.md" %} +[commands.md](fundamentals/commands.md) +{% endcontent-ref %} + +{% content-ref url="fundamentals/events.md" %} +[events.md](fundamentals/events.md) +{% endcontent-ref %} + +{% content-ref url="fundamentals/buttons-and-menus.md" %} +[buttons-and-menus.md](fundamentals/buttons-and-menus.md) +{% endcontent-ref %} + +{% content-ref url="fundamentals/context-menu-actions.md" %} +[context-menu-actions.md](fundamentals/context-menu-actions.md) +{% endcontent-ref %} diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md new file mode 100644 index 000000000..626bdedee --- /dev/null +++ b/docs/SUMMARY.md @@ -0,0 +1,22 @@ +# Table of contents + +* [What is WildBeast?](README.md) + +## Guides + +* [Linux guides](guides/linux-guides/README.md) + * [Setup](guides/linux-guides/setup.md) + * [Running as a service](guides/linux-guides/running-as-a-service.md) + +## Fundamentals + +* [Commands](fundamentals/commands.md) +* [Events](fundamentals/events.md) +* [Buttons and menus](fundamentals/buttons-and-menus.md) +* [Context menu actions](fundamentals/context-menu-actions.md) + +## Extras + +* [VPS recommendations](extras/vps-recommendations.md) +* [Creating a bot account](extras/creating-a-bot-account.md) +* [Adding your bot to your server](extras/adding-your-bot-to-your-server.md) diff --git a/docs/extras/adding-your-bot-to-your-server.md b/docs/extras/adding-your-bot-to-your-server.md new file mode 100644 index 000000000..89faa3098 --- /dev/null +++ b/docs/extras/adding-your-bot-to-your-server.md @@ -0,0 +1,22 @@ +--- +description: This page will show you how to invite your bot to your servers. +--- + +# Adding your bot to your server + +{% hint style="info" %} +Don’t have a bot account yet? Check out [this page](creating-a-bot-account.md) for instructions how to make one. +{% endhint %} + +1. Once you have created a bot account, navigate to the OAuth2 page of your application![](../.gitbook/assets/wildebeest2.png) +2. Scroll down to the OAuth2 URL Generator and check the "applications.commands" and "bot" scopes + + ![](../.gitbook/assets/image.png) +3. Copy the link it generates and open it in a new tab, choosing what server you want to add it to, and hit "Authorize" + + ![](../.gitbook/assets/wildebeest1.png) + +{% hint style="warning" %} +Don’t see the server you want to add the bot to? You need to have the ”Manage Server” permission in the server for it to show up. +{% endhint %} + diff --git a/docs/extras/creating-a-bot-account.md b/docs/extras/creating-a-bot-account.md new file mode 100644 index 000000000..4736fd57d --- /dev/null +++ b/docs/extras/creating-a-bot-account.md @@ -0,0 +1,31 @@ +--- +description: This page will describe, in detail, how to obtain a token for your bot. +--- + +# Creating a bot account + +1. Navigate to your [Applications Page](https://discord.com/developers/applications) (you might need to login for this) +2. Click "New Application" on the top right of the page + + ![](<../.gitbook/assets/afbeelding (2).png>) +3. Think of a name for your bot, and click "Create" + + ![](<../.gitbook/assets/afbeelding (7).png>) +4. Navigate to the "Bot" tab + + ![](<../.gitbook/assets/afbeelding (3).png>) +5. Click "Add Bot" on the left of the page + + ![](../.gitbook/assets/afbeelding.png) +6. Click "Yes, do it!" + + ![](<../.gitbook/assets/afbeelding (4).png>) +7. Optionally, set an avatar and change the username, and click "Save". +8. Select the "Copy" button to copy your bot's token. + + ![](<../.gitbook/assets/afbeelding (10).png>) + + + + + diff --git a/docs/extras/vps-recommendations.md b/docs/extras/vps-recommendations.md new file mode 100644 index 000000000..42ae85d8f --- /dev/null +++ b/docs/extras/vps-recommendations.md @@ -0,0 +1,40 @@ +--- +description: Need to run WildBeast 24/7? Get a cheap VPS. +--- + +# VPS recommendations + +Need to run WildBeast 24/7? Get a cheap VPS. We recommend any of the below. + +### [Hetzner](https://hetzner.cloud/?ref=TrwA0pf5HM06) + +Cheap Finland and Germany-based VPSes. + +### [DigitalOcean](https://m.do.co/c/3ead1675d3af) + +The gold standard. Locations available worldwide. + +### [Scaleway](https://scaleway.com) + +Incredibly cheap but powerful VPSes, owned by online.net, based in France and The Netherlands. + +### [Xenyth](https://xenyth.net) + +A hosting solution made by Discord bot developers, aimed at a lower price range, starting from $2.49. + +### [OVH](https://ovh.com) + +Cheap VPSes, used by many people. France and Canadian locations available. + +### [Linode](https://linode.com) + +US-based VPS provider, locations available worldwide. + +### [Vultr](https://www.vultr.com/?ref=8379976) + +US-based VPS provider, locations available worldwide. + + + + + diff --git a/docs/fundamentals/buttons-and-menus.md b/docs/fundamentals/buttons-and-menus.md new file mode 100644 index 000000000..a0616edac --- /dev/null +++ b/docs/fundamentals/buttons-and-menus.md @@ -0,0 +1,7 @@ +--- +description: Add buttons and select menus to your custom commands +--- + +# Buttons and menus + +WIP diff --git a/docs/fundamentals/commands.md b/docs/fundamentals/commands.md new file mode 100644 index 000000000..c4fe2ede7 --- /dev/null +++ b/docs/fundamentals/commands.md @@ -0,0 +1,7 @@ +--- +description: Write your own custom commands +--- + +# Commands + +WIP diff --git a/docs/fundamentals/context-menu-actions.md b/docs/fundamentals/context-menu-actions.md new file mode 100644 index 000000000..825eb1289 --- /dev/null +++ b/docs/fundamentals/context-menu-actions.md @@ -0,0 +1,7 @@ +--- +description: Do cool stuff with right-click menu commands +--- + +# Context menu actions + +WIP diff --git a/docs/fundamentals/events.md b/docs/fundamentals/events.md new file mode 100644 index 000000000..ee4fa3131 --- /dev/null +++ b/docs/fundamentals/events.md @@ -0,0 +1,7 @@ +--- +description: Do cool stuff with your own event handlers +--- + +# Events + +WIP diff --git a/docs/guides/linux-guides/README.md b/docs/guides/linux-guides/README.md new file mode 100644 index 000000000..b4a23cf1d --- /dev/null +++ b/docs/guides/linux-guides/README.md @@ -0,0 +1,2 @@ +# Linux guides + diff --git a/docs/guides/linux-guides/running-as-a-service.md b/docs/guides/linux-guides/running-as-a-service.md new file mode 100644 index 000000000..94b708e2a --- /dev/null +++ b/docs/guides/linux-guides/running-as-a-service.md @@ -0,0 +1,83 @@ +--- +description: Using systemd, run WildBeast as a service for automatic (re)starting +--- + +# Running as a service + +{% hint style="info" %} +**Good to know:** This guide uses `systemd`, we're assuming this is present on your system. + +If you're using Ubuntu 20.04, you're already using `systemd`. +{% endhint %} + +## Making a new service + +Start creating a new service: + +``` +sudo nano /etc/systemd/system/wildbeast.service +``` + +Copy and paste the following example: + +```ini +[Unit] +After=network.target network-online.target +Requires=network.target network-online.target +StartLimitBurst=3 +StartLimitIntervalSec=0 + +[Service] +WorkingDirectory=/REPLACE THIS +Type=simple +Restart=on-failure +RestartSec=1 +User=REPLACE THIS +ExecStart=/usr/bin/env npm start + +[Install] +WantedBy=multi-user.target +``` + +{% hint style="warning" %} +Pay attention to the `REPLACE THIS`, as you might've guessed you need to replace these values. + +* `WorkingDirectory` - The folder where you saved WildBeast + + For example: `/home/wildbeast/WildBeast` +* `User` - The user that's going to run WildBeast + + Do **NOT **use `root`, [create a new user](https://www.digitalocean.com/community/tutorials/how-to-create-a-new-sudo-enabled-user-on-ubuntu-20-04-quickstart) for safety. +{% endhint %} + +## Controlling the service + +### Starting + +``` +sudo systemctl start wildbeast.service +``` + +### Stopping + +``` +sudo systemctl stop wildbeast.service +``` + +### Start on boot + +``` +sudo systemctl enable wildbeast.service +``` + +To undo: + +``` +sudo systemctl disable wildbeast.service +``` + +### Restarting + +``` +sudo systemctl restart wildbeast.service +``` diff --git a/docs/guides/linux-guides/setup.md b/docs/guides/linux-guides/setup.md new file mode 100644 index 000000000..e8d1863c8 --- /dev/null +++ b/docs/guides/linux-guides/setup.md @@ -0,0 +1,129 @@ +--- +description: Instructions to run WildBeast on Linux +--- + +# Setup + +## The basics + +{% hint style="info" %} +**Good to know:** For the purpose of this guide, we'll use [Ubuntu 20.04](https://ubuntu.com). + +Any modern Linux distribution will work, however the commands described here only work on Debian based distributions. +{% endhint %} + +{% hint style="warning" %} +For safety reasons, please **don't run WildBeast with the `root` account.** + +If you don't know how to create a new user on Linux, please see [DigitalOcean's guide on making new sudo-enabled users](https://www.digitalocean.com/community/tutorials/how-to-create-a-new-sudo-enabled-user-on-ubuntu-20-04-quickstart) +{% endhint %} + +We need a few prerequisites: + +* A computer running any [supported version of Ubuntu](https://github.com/nodesource/distributions#debian-and-ubuntu-based-distributions) + * You need `sudo` or `doas` privileges, or access to the `root` account + * If you want to run WildBeast 24/7, you should get a [VPS](../../extras/vps-recommendations.md) +* [Git](https://git-scm.com/download/linux) +* A text editor. We're going to use `nano`, but you can use anything you'd like. + +## Installation + +### Installing Node.js + +1. Run the following code in your terminal: + + ``` + curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - + ``` + + (Not a fan of `curl | bash -`? You can do this [manually](https://github.com/nodesource/distributions#manual-installation) too.) +2. Install Node.js with the following command: + + ``` + sudo apt-get install -y nodejs + ``` + +### Installing Postgres + +Postgres is available to install by default on Ubuntu, just run the following code in your terminal: + +```bash +sudo apt install postgresql postgresql-contrib +``` + +We need to do some extra steps to prepare Postgres for use: + +1. Create a new user for WildBeast to use: + + ```bash + sudo -u postgres createuser --interactive + ``` + + The new user does **not** need to be a superuser, and can be called whatever you want. +2. Finally, create a new database: + + ```bash + sudo -u postgres createdb wildbeast + ``` + + (We used `wildbeast` here as the database user, change it if you used something else in the previous step) + +## Setting up + +### Getting the code + +Clone the code and install the required modules: + +``` +git clone https://github.com/TheSharks/WildBeast.git +cd ./WildBeast +npm install +``` + +### Setting the options + +Open the example configuration file in `nano` and enter your details: + +``` +nano .env.example +``` + +When you're done, **save the file as `.env`** + +### **Starting the database** + +Before we can start, we need to initialize the database. Run the following code: + +``` +npm run-script migrations:up +``` + +### **Testing it out!** + +Now for the fun part, testing to see if it worked! + +Start WildBeast for the first time with the following command: + +``` +npm start +``` + +You should see something similar to the following if everything went well + +`19:11:41 [info] Gateway: Client ready ` + +`19:11:41 [info] Gateway - shard 0: Gateway ready` + +Test if your bot works by running the `/ping` command + +![](<../../.gitbook/assets/afbeelding (6).png>) + +{% hint style="info" %} +Slash commands can take a while to appear. + +Don't have your bot in your server yet? Check [this guide.](../../extras/adding-your-bot-to-your-server.md) +{% endhint %} + +### Next steps + +* [Running as a service for autostart](running-as-a-service.md)