kaboom (nuke)
This commit is contained in:
parent
84e58f5c43
commit
393123b95d
34 changed files with 1 additions and 9872 deletions
53
.github/workflows/deploy.yml
vendored
53
.github/workflows/deploy.yml
vendored
|
@ -1,53 +0,0 @@
|
||||||
name: documentation
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches: [master]
|
|
||||||
push:
|
|
||||||
branches: [master]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
checks:
|
|
||||||
if: github.event_name != 'push'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: '16.x'
|
|
||||||
- name: Test Build
|
|
||||||
run: |
|
|
||||||
if [ -e yarn.lock ]; then
|
|
||||||
yarn install --frozen-lockfile
|
|
||||||
elif [ -e package-lock.json ]; then
|
|
||||||
npm ci
|
|
||||||
else
|
|
||||||
npm i
|
|
||||||
fi
|
|
||||||
npm run build
|
|
||||||
gh-release:
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: '16.x'
|
|
||||||
- uses: webfactory/ssh-agent@v0.5.3
|
|
||||||
with:
|
|
||||||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
||||||
- name: Release to GitHub Pages
|
|
||||||
env:
|
|
||||||
USE_SSH: true
|
|
||||||
GIT_USER: developomp
|
|
||||||
run: |
|
|
||||||
git config --global user.email "developomp@gmail.com"
|
|
||||||
git config --global user.name "developomp"
|
|
||||||
if [ -e yarn.lock ]; then
|
|
||||||
yarn install --frozen-lockfile
|
|
||||||
elif [ -e package-lock.json ]; then
|
|
||||||
npm ci
|
|
||||||
else
|
|
||||||
npm i
|
|
||||||
fi
|
|
||||||
npm run deploy
|
|
20
.gitignore
vendored
20
.gitignore
vendored
|
@ -1,20 +0,0 @@
|
||||||
# Dependencies
|
|
||||||
/node_modules
|
|
||||||
|
|
||||||
# Production
|
|
||||||
/build
|
|
||||||
|
|
||||||
# Generated files
|
|
||||||
/.docusaurus
|
|
||||||
.cache-loader/
|
|
||||||
|
|
||||||
# Misc
|
|
||||||
.DS_Store
|
|
||||||
.env.local
|
|
||||||
.env.development.local
|
|
||||||
.env.test.local
|
|
||||||
.env.production.local
|
|
||||||
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"semi": true,
|
|
||||||
"singleQuote": true
|
|
||||||
}
|
|
6
.vscode/settings.json
vendored
6
.vscode/settings.json
vendored
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"editor.formatOnPaste": true,
|
|
||||||
"editor.formatOnSave": true,
|
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
||||||
"cSpell.words": ["Firestore", "clsx"]
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
[Go here](https://github.com/llama-bot/llama-bot/blob/master/CONTRIBUTING.md)
|
|
21
LICENSE
21
LICENSE
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2021 developomp
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
|
@ -1,3 +1,3 @@
|
||||||
# llama-bot-docs
|
# llama-bot-docs
|
||||||
|
|
||||||
## [Documentation](https://docs.llama.developomp.com)
|
**This project is dead.**
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
|
|
||||||
};
|
|
|
@ -1,36 +0,0 @@
|
||||||
# Overview
|
|
||||||
|
|
||||||
:::warning
|
|
||||||
**The Llama Bot is under heavy development.**<br />
|
|
||||||
It can not even be called unstable. Most of the features are not written yet.
|
|
||||||
:::
|
|
||||||
|
|
||||||
The Llama bot is a [discord](https://discord.com) bot made for the [LP community discord server](https://discord.gg/2fsar34APa).<br />
|
|
||||||
It has a web GUI frontend for quick and easy usage, and it also has an HTTP API for more complex apps to be built on top of it.
|
|
||||||
|
|
||||||
## FAQ
|
|
||||||
|
|
||||||
### Can I use this bot in my discord server?
|
|
||||||
|
|
||||||
You can not invite this bot to your server, unfortunately.<br />
|
|
||||||
However, since the source code is available on [github](https://github.com/llama-bot), you **can** set up the bot yourself though it requires quite a bit of technical knowledge.
|
|
||||||
|
|
||||||
You need to be familiar with the following to be more specific:
|
|
||||||
|
|
||||||
- [git](https://git-scm.com) (and [github](https://github.com))
|
|
||||||
- [linux servers](https://www.tutorialspoint.com/unix)
|
|
||||||
- [discord bots](https://discord.com/developers/docs)
|
|
||||||
|
|
||||||
If you think you are ready to setup the bot yourself, head over to the following pages:
|
|
||||||
|
|
||||||
- [Setting up the Llama bot](/docs/bot/setting-up)
|
|
||||||
- [Setting up the web interface](/docs/web-interface/setting-up)
|
|
||||||
|
|
||||||
### I want to contribute! Where do I start?
|
|
||||||
|
|
||||||
If you are a developer and want to contribute to the project, the [contribution guide](https://github.com/llama-bot/llama-bot/blob/master/CONTRIBUTING.md) should be a good place to start.
|
|
||||||
|
|
||||||
## Special thanks
|
|
||||||
|
|
||||||
- `Dabidoo#9888 (265697563280146433)` for making the [colored logo](/img/logo.png)
|
|
||||||
- `Sɪʟᴋ Sᴘɪᴅᴇʀ#8364 (419184817368858644)` for making the [white logo](/img/logo-white.png)
|
|
|
@ -1,91 +0,0 @@
|
||||||
# Overview
|
|
||||||
|
|
||||||
If you are a non-technical discord user and want to learn how to use the Llama bot, you've come to the right place.
|
|
||||||
In this page, you'll learn the basics of discord bots, what the Llama bot can do, and how to use it.
|
|
||||||
|
|
||||||
## Background
|
|
||||||
|
|
||||||
### What even is a discord bot?
|
|
||||||
|
|
||||||
In essence, a Discord bot is a account controlled by a program.
|
|
||||||
It is used in almost ever server for many different reasons such as automating moderation, music streaming, and even dad jokes.
|
|
||||||
|
|
||||||
### Great! Now, how do I use a bot?
|
|
||||||
|
|
||||||
Although some bots — including the Llama bot — offers a web interface, most bots are controlled by commands.
|
|
||||||
Commands are messages that is prefixed with special letter(s) that tells what a bot should do.
|
|
||||||
|
|
||||||
Here's an example of a command:
|
|
||||||
|
|
||||||
```
|
|
||||||
-help
|
|
||||||
```
|
|
||||||
|
|
||||||
Here, the hyphen (`-`) is the prefix and `help` is the command.
|
|
||||||
When messages are formatted like this, bots can identify whether a message is a command or not, and if the command is meant for them or some other bot.
|
|
||||||
This is helpful when there are multiple bots in one server.
|
|
||||||
Commonly used prefixes are: `?`, `!`, `>`, `.`, `..`, etc.
|
|
||||||
|
|
||||||
Although Discord released [slash commands](https://discord.com/blog/slash-commands-are-here) in 2021, it is not used by most bot developers.
|
|
||||||
|
|
||||||
### Commands are not enough!
|
|
||||||
|
|
||||||
Although commands are awesome, sometimes it is not enough to tell what exactly you want the bot to do.
|
|
||||||
This is why you need arguments.
|
|
||||||
|
|
||||||
Here's an example of a command with arguments:
|
|
||||||
|
|
||||||
```
|
|
||||||
-ban @NaughtyUser @BadUser @GPUScalper69
|
|
||||||
```
|
|
||||||
|
|
||||||
Arguments are extra text information that are passed with the command.
|
|
||||||
Arguments could be a user, a text channel, regular text, numbers, or even emojis.
|
|
||||||
They are usually separated by spaces.
|
|
||||||
If you provide more arguments than what's required, they will simply be ignored.
|
|
||||||
|
|
||||||
## How to read the documentation
|
|
||||||
|
|
||||||
WIP
|
|
||||||
|
|
||||||
<!-- list of commands. Web interface instruction will be included if it exists -->
|
|
||||||
|
|
||||||
### Required arguments
|
|
||||||
|
|
||||||
WIP
|
|
||||||
|
|
||||||
### Optional arguments
|
|
||||||
|
|
||||||
WIP
|
|
||||||
|
|
||||||
### Examples
|
|
||||||
|
|
||||||
#### A command with one required argument
|
|
||||||
|
|
||||||
```
|
|
||||||
-command <arg1>
|
|
||||||
```
|
|
||||||
|
|
||||||
#### A command with a required argument and a optional one
|
|
||||||
|
|
||||||
```
|
|
||||||
-command <arg1> [arg2]
|
|
||||||
```
|
|
||||||
|
|
||||||
#### A command with arbitrary amount of optional arguments
|
|
||||||
|
|
||||||
```
|
|
||||||
-command [args]*
|
|
||||||
```
|
|
||||||
|
|
||||||
#### A command that takes neither or both arguments
|
|
||||||
|
|
||||||
```
|
|
||||||
-command [<arg1> <arg2>]
|
|
||||||
```
|
|
||||||
|
|
||||||
#### A command that only takes either "a" or "b"
|
|
||||||
|
|
||||||
```
|
|
||||||
-command <"a"|"b">
|
|
||||||
```
|
|
|
@ -1,15 +0,0 @@
|
||||||
# Commands
|
|
||||||
|
|
||||||
## `help`
|
|
||||||
|
|
||||||
The most basic command and the a easy way to get information about a command/command category.
|
|
||||||
|
|
||||||
If no argument is passed, this command will list all command categories regardless of whether it is enabled or not.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### `help <category>`
|
|
||||||
|
|
||||||
### `help <command>`
|
|
||||||
|
|
||||||
## `ping`
|
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"label": "Usage",
|
|
||||||
"position": 2
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
# Overview
|
|
|
@ -1,101 +0,0 @@
|
||||||
# Setting up
|
|
||||||
|
|
||||||
:::info
|
|
||||||
This documentation uses the [dev branch](https://github.com/llama-bot/llama-bot/tree/dev) (javascript) instead of the master branch (python).
|
|
||||||
:::
|
|
||||||
|
|
||||||
In this documentation, you will learn how to set up the [llama discord bot](https://github.com/llama-bot/llama-bot).
|
|
||||||
|
|
||||||
## Steps
|
|
||||||
|
|
||||||
### Pre-requirements
|
|
||||||
|
|
||||||
- Node.js 16.6.0+
|
|
||||||
- [yarn](https://yarnpkg.com)
|
|
||||||
- A Discord account
|
|
||||||
- A Google Firebase account
|
|
||||||
- ~~A sacrifice to be given to the llama gods~~ (no longer needed)
|
|
||||||
|
|
||||||
### Discord
|
|
||||||
|
|
||||||
1. Create a new application from the [Discord Developer Portal](https://discord.com/developers/applications). Select one if you already have it.
|
|
||||||
2. Go to the `Bot` tab and convert your application to a discord bot. Be cautious since this operation is **NOT REVERSIBLE**.
|
|
||||||
3. Copy the bot token. This will be used during the [Server](#server) setup.
|
|
||||||
|
|
||||||
### Firebase
|
|
||||||
|
|
||||||
1. Create a firebase project.
|
|
||||||
|
|
||||||
https://console.firebase.google.com
|
|
||||||
|
|
||||||
2. Enable firestore database (usage of production mode is highly recommended).
|
|
||||||
3. [Generate and download](https://console.firebase.google.com/project/_/settings/serviceaccounts/adminsdk) the service account key. This will be used during the [Server](#server) setup.
|
|
||||||
|
|
||||||
### Server
|
|
||||||
|
|
||||||
:::info
|
|
||||||
Assumes UNIX-like environment (Linux, BSD, Mac, etc.)
|
|
||||||
:::
|
|
||||||
|
|
||||||
1. Clone the llama bot [repository](https://github.com/llama-bot/llama-bot) and open it.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/llama-bot/llama-bot.git
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd llama-bot
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Install dependencies.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn install
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Create `.env` file in the project root and put the discord bot token generated during the [Discord](#discord) setup.
|
|
||||||
|
|
||||||
```text title=".env"
|
|
||||||
TOKEN=PUT_YOUR_DISCORD_BOT_TOKEN_HERE
|
|
||||||
TESTING=true # set it to false on production
|
|
||||||
PREFIX_PROD=PUT_PRODUCTION_DEFAULT_PREFIX_HERE
|
|
||||||
PREFIX_DEV=PUT_DEVELOPMENT_DEFAULT_PREFIX_HERE
|
|
||||||
OWNER_IDS=ID1,ID2,ID3,...
|
|
||||||
```
|
|
||||||
|
|
||||||
4. Create `secret` directory in the `src` directory, rename the firebase admin key generated during the [Firebase](#firebase) setup to `firebase-adminsdk.json`, and put it in the `secret` directory.
|
|
||||||
5. Build the bot.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn build
|
|
||||||
```
|
|
||||||
|
|
||||||
6. Install pm2 globally.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn global add pm2
|
|
||||||
```
|
|
||||||
|
|
||||||
7. Start the bot.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pm2 start build/index.js --watch --name "Llama Bot"
|
|
||||||
```
|
|
||||||
|
|
||||||
| Option | Explanation |
|
|
||||||
| -------------------- | ---------------------------------------------------------- |
|
|
||||||
| `--watch` | Auto restart bot if bot files have been changed |
|
|
||||||
| `--name "Llama Bot"` | Set the name of the process so it can be easily recognized |
|
|
||||||
|
|
||||||
8. Make the process automatically start on boot.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pm2 startup
|
|
||||||
```
|
|
||||||
|
|
||||||
## More info
|
|
||||||
|
|
||||||
- [discord developers documentation](https://discord.com/developers/docs)
|
|
||||||
- discord API's javascript implementation [documentation](https://discord.js.org/#/docs), [guide](https://discordjs.guide), and bot [framework documentation](https://sapphiredev.github.io/framework)
|
|
||||||
- [firebase admin sdk documentation](https://firebase.google.com/docs)
|
|
||||||
- [pm2 documentation](https://pm2.keymetrics.io/docs/usage/quick-start)
|
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"label": "Bot",
|
|
||||||
"position": 3
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
# Overview
|
|
||||||
|
|
||||||
A full stack web graphical user interface for the [llama bot](https://github.com/llama-bot/llama-bot).
|
|
||||||
|
|
||||||
## Special thanks
|
|
||||||
|
|
||||||
- [luizkc](https://github.com/luizkc) for discord oauth2 authentication ([repo](https://github.com/luizkc/firebase-discord-oauth2-example))
|
|
||||||
- [charfweh](https://github.com/charfweh) for a full stack discord login example ([repo](https://github.com/charfweh/Discord-Oauth-Mern))
|
|
|
@ -1,171 +0,0 @@
|
||||||
# Setting up
|
|
||||||
|
|
||||||
This page will teach you how to set up the [Llama bot web Interface](https://github.com/llama-bot/llama-bot-web-interface).
|
|
||||||
|
|
||||||
## Steps
|
|
||||||
|
|
||||||
### Pre-requirements
|
|
||||||
|
|
||||||
- Node.js version 14 or greater (version 16 is recommended)
|
|
||||||
- yarn
|
|
||||||
- Discord account
|
|
||||||
- Google account
|
|
||||||
- Payment method (No payment required for light usage. More info [here](https://firebase.google.com/pricing))
|
|
||||||
|
|
||||||
### Discord
|
|
||||||
|
|
||||||
1. Go to the [Discord Developer Portal](https://discord.com/developers/applications) and create an application. Select one if you already have it. You may use the same application used by the discord bot.
|
|
||||||
2. Go to OAuth2 tab.
|
|
||||||
3. Add the following redirects:
|
|
||||||
|
|
||||||
- testing (http): `http://localhost:5000/api/auth`
|
|
||||||
- production (https): `https://<YOUR_SITE_NAME_HERE>/api/auth` (e.g. `https://llama.developomp.com/api/auth`)
|
|
||||||
|
|
||||||
### Firebase
|
|
||||||
|
|
||||||
1. [Create](https://console.firebase.google.com) a firebase project. Select one if you already have it. It must be the same project used by the discord bot. Make sure it is using the [blaze plan](https://firebase.google.com/pricing).
|
|
||||||
2. Go to the `Firestore Database` tab and enable it. Usage of production mode is highly recommended.
|
|
||||||
|
|
||||||
### Local
|
|
||||||
|
|
||||||
Clone the [llama-bot-web-interface](https://github.com/llama-bot/llama-bot-web-interface) repository.
|
|
||||||
|
|
||||||
### Functions
|
|
||||||
|
|
||||||
1. Edit `functions/src/config.json`.
|
|
||||||
|
|
||||||
```json title="functions/src/config.json (default values)"
|
|
||||||
{
|
|
||||||
"pathPrefix": "/api", // where the API endpoints will be located. Set it to "/" if it's on another domain (example: api.example.com)
|
|
||||||
"scopes": ["identify", "email", "guilds"] // Discord OAuth2 scopes.
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
more info about discord OAuth2 scopes can be found in the [discord developers documentation](https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes)
|
|
||||||
|
|
||||||
2. Create `functions/src/secret.json`.
|
|
||||||
|
|
||||||
```json title="functions/src/secret.json"
|
|
||||||
{
|
|
||||||
"clientID": "DISCORD_CLIENT_ID_HERE", // Discord OAuth2 Client ID
|
|
||||||
"clientSecret": "DISCORD_CLIENT_SECRET_HERE", // Discord OAuth2 Client Secret
|
|
||||||
"secret": "SECRET_COOKIE_KEY_HERE" // secret key to be used for express session security
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Visit [this link](https://console.firebase.google.com/project/_/settings/serviceaccounts/adminsdk), select your firebase project and download the firebase admin sdk key by pressing the "Generate new private key" button. Rename the downloaded file to `firebase-adminsdk.json` and put it in the `functions/src/` directory.
|
|
||||||
|
|
||||||
4. Install firebase tools.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn global add firebase-tools
|
|
||||||
```
|
|
||||||
|
|
||||||
5. Select your firebase project. You must run this command in the project root.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
firebase use <FIREBASE_PROJECT_ID_HERE>
|
|
||||||
```
|
|
||||||
|
|
||||||
6. Go to the `functions` directory and install the dependencies.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn install
|
|
||||||
```
|
|
||||||
|
|
||||||
7. Build production code.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn build
|
|
||||||
```
|
|
||||||
|
|
||||||
### Frontend
|
|
||||||
|
|
||||||
1. Go to the `frontend` directory and install the dependencies.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn install
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Test with hot reloading.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn dev
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Build site for production.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn build
|
|
||||||
```
|
|
||||||
|
|
||||||
4. Preview the production build
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn preview
|
|
||||||
```
|
|
||||||
|
|
||||||
### Testing
|
|
||||||
|
|
||||||
After building the backend and the frontend code, run the following command to start a local test server:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
firebase serve
|
|
||||||
```
|
|
||||||
|
|
||||||
### Deployment
|
|
||||||
|
|
||||||
Deploying the code to production is as simple as running the following command:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
firebase deploy
|
|
||||||
```
|
|
||||||
|
|
||||||
The deployment could take a while so be patient.
|
|
||||||
|
|
||||||
Deploying frontend code only:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
firebase deploy --only hosting
|
|
||||||
```
|
|
||||||
|
|
||||||
Deploying backend code only:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
firebase deploy --only functions
|
|
||||||
```
|
|
||||||
|
|
||||||
### Automated deployment
|
|
||||||
|
|
||||||
If you are using github, you can easily automate the deployment process.
|
|
||||||
The web interface repository is configured to use [Github action](https://github.com/features/actions) to automatically deploy changes made to the `master` branch.
|
|
||||||
We recommend you do the development in the `dev` branch and put production code in the `master` branch.
|
|
||||||
|
|
||||||
Go to repository Settings > Secrets (side bar) > Actions (dropdown)<br />
|
|
||||||
and create the following secrets by clicking the New repository secret button.
|
|
||||||
|
|
||||||
- `FIREBASE_TOKEN`
|
|
||||||
|
|
||||||
You can get this by running the following command:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
firebase login:ci
|
|
||||||
```
|
|
||||||
|
|
||||||
- `FIREBASE_PROJECT`
|
|
||||||
|
|
||||||
This is the firebase project ID you are using. It should be inside the `.firebaserc` file.
|
|
||||||
|
|
||||||
- `SECRET_JSON`
|
|
||||||
|
|
||||||
Content of `functions/src/secret.json`
|
|
||||||
|
|
||||||
- `FIREBASE_ADMINSDK_JSON`
|
|
||||||
|
|
||||||
Content of `functions/src/firebase-adminsdk.json`
|
|
||||||
|
|
||||||
## More info
|
|
||||||
|
|
||||||
- [discord developers documentation](https://discord.com/developers/docs)
|
|
||||||
- [firebase admin sdk documentation](https://firebase.google.com/docs)
|
|
||||||
- [firebase functions documentation](https://firebase.google.com/docs/functions/typescript)
|
|
|
@ -1,23 +0,0 @@
|
||||||
# API
|
|
||||||
|
|
||||||
HTTP endpoints.
|
|
||||||
|
|
||||||
## Authentication
|
|
||||||
|
|
||||||
### `/api/login`
|
|
||||||
|
|
||||||
Login using discord OAuth2
|
|
||||||
|
|
||||||
### `/api/logout`
|
|
||||||
|
|
||||||
Logout from account
|
|
||||||
|
|
||||||
### `/api/auth`
|
|
||||||
|
|
||||||
Discord OAuth2 callback
|
|
||||||
|
|
||||||
## Data
|
|
||||||
|
|
||||||
### `/api/user-data`
|
|
||||||
|
|
||||||
Basic data about the user
|
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"label": "Web Interface",
|
|
||||||
"position": 4
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
# Overview
|
|
|
@ -1,29 +0,0 @@
|
||||||
# Setting Up
|
|
||||||
|
|
||||||
## Steps
|
|
||||||
|
|
||||||
### Local
|
|
||||||
|
|
||||||
1. Install node.js and yarn.
|
|
||||||
|
|
||||||
2. Clone the [documentation repository](https://github.com/llama-bot/llama-bot-docs).
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/llama-bot/llama-bot-docs
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Install dependencies.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn install
|
|
||||||
```
|
|
||||||
|
|
||||||
4. Test locally. Live edit is supported.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn start
|
|
||||||
```
|
|
||||||
|
|
||||||
### Deployment
|
|
||||||
|
|
||||||
1. Follow the [instructions from docusaurus](https://docusaurus.io/docs/deployment#deploying-to-github-pages)
|
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"label": "Docs",
|
|
||||||
"position": 5
|
|
||||||
}
|
|
|
@ -1,56 +0,0 @@
|
||||||
const lightCodeTheme = require('prism-react-renderer/themes/github');
|
|
||||||
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
|
|
||||||
|
|
||||||
/** @type {import('@docusaurus/types').DocusaurusConfig} */
|
|
||||||
module.exports = {
|
|
||||||
title: 'Llama Bot Documentation',
|
|
||||||
tagline: '',
|
|
||||||
url: 'https://docs.llama.developomp.com',
|
|
||||||
baseUrl: '/',
|
|
||||||
onBrokenLinks: 'throw',
|
|
||||||
onBrokenMarkdownLinks: 'warn',
|
|
||||||
favicon: 'img/logo.png',
|
|
||||||
trailingSlash: false,
|
|
||||||
organizationName: 'llama-bot',
|
|
||||||
projectName: 'llama-bot-docs',
|
|
||||||
themeConfig: {
|
|
||||||
navbar: {
|
|
||||||
title: 'Llama Bot Docs',
|
|
||||||
logo: {
|
|
||||||
alt: 'Llama Bot Logo',
|
|
||||||
src: 'img/logo.png',
|
|
||||||
href: '/docs/overview',
|
|
||||||
},
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
href: 'https://github.com/llama-bot/llama-bot-docs',
|
|
||||||
label: 'GitHub',
|
|
||||||
position: 'right',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
footer: {
|
|
||||||
style: 'dark',
|
|
||||||
copyright: `Created by <b>developomp</b>. Built with <a href="https://github.com/facebook/docusaurus">Docusaurus</a>.`,
|
|
||||||
},
|
|
||||||
prism: {
|
|
||||||
theme: lightCodeTheme,
|
|
||||||
darkTheme: darkCodeTheme,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
presets: [
|
|
||||||
[
|
|
||||||
'@docusaurus/preset-classic',
|
|
||||||
{
|
|
||||||
docs: {
|
|
||||||
sidebarPath: require.resolve('./sidebars.js'),
|
|
||||||
// Please change this to your repo.
|
|
||||||
editUrl: 'https://github.com/llama-bot/llama-bot-docs/edit/master/',
|
|
||||||
},
|
|
||||||
theme: {
|
|
||||||
customCss: require.resolve('./src/css/custom.css'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
};
|
|
43
package.json
43
package.json
|
@ -1,43 +0,0 @@
|
||||||
{
|
|
||||||
"name": "llama-bot-docs",
|
|
||||||
"version": "0.0.0",
|
|
||||||
"private": true,
|
|
||||||
"scripts": {
|
|
||||||
"docusaurus": "docusaurus",
|
|
||||||
"start": "docusaurus start",
|
|
||||||
"build": "docusaurus build",
|
|
||||||
"swizzle": "docusaurus swizzle",
|
|
||||||
"deploy": "docusaurus deploy",
|
|
||||||
"clear": "docusaurus clear",
|
|
||||||
"serve": "docusaurus serve",
|
|
||||||
"write-translations": "docusaurus write-translations",
|
|
||||||
"write-heading-ids": "docusaurus write-heading-ids"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@docusaurus/core": "^2.0.0-beta.15",
|
|
||||||
"@docusaurus/preset-classic": "^2.0.0-beta.15",
|
|
||||||
"@fortawesome/fontawesome-svg-core": "^1.3.0",
|
|
||||||
"@fortawesome/free-solid-svg-icons": "^5.15.4",
|
|
||||||
"@fortawesome/react-fontawesome": "^0.1.17",
|
|
||||||
"@mdx-js/react": "^1.6.22",
|
|
||||||
"@svgr/webpack": "^5.5.0",
|
|
||||||
"clsx": "^1.1.1",
|
|
||||||
"file-loader": "^6.2.0",
|
|
||||||
"prism-react-renderer": "^1.3.1",
|
|
||||||
"react": "^17.0.2",
|
|
||||||
"react-dom": "^17.0.2",
|
|
||||||
"url-loader": "^4.1.1"
|
|
||||||
},
|
|
||||||
"browserslist": {
|
|
||||||
"production": [
|
|
||||||
">0.5%",
|
|
||||||
"not dead",
|
|
||||||
"not op_mini all"
|
|
||||||
],
|
|
||||||
"development": [
|
|
||||||
"last 1 chrome version",
|
|
||||||
"last 1 firefox version",
|
|
||||||
"last 1 safari version"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
31
sidebars.js
31
sidebars.js
|
@ -1,31 +0,0 @@
|
||||||
/**
|
|
||||||
* Creating a sidebar enables you to:
|
|
||||||
- create an ordered group of docs
|
|
||||||
- render a sidebar for each doc of that group
|
|
||||||
- provide next/previous navigation
|
|
||||||
|
|
||||||
The sidebars can be generated from the filesystem, or explicitly defined here.
|
|
||||||
|
|
||||||
Create as many sidebars as you want.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
// By default, Docusaurus generates a sidebar from the docs folder structure
|
|
||||||
tutorialSidebar: [
|
|
||||||
{
|
|
||||||
type: 'autogenerated',
|
|
||||||
dirName: '.',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
|
|
||||||
// But you can create a sidebar manually
|
|
||||||
/*
|
|
||||||
tutorialSidebar: [
|
|
||||||
{
|
|
||||||
type: 'category',
|
|
||||||
label: 'Tutorial',
|
|
||||||
items: ['hello'],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
*/
|
|
||||||
};
|
|
|
@ -1,29 +0,0 @@
|
||||||
/* stylelint-disable docusaurus/copyright-header */
|
|
||||||
/**
|
|
||||||
* Any CSS included here will be global. The classic template
|
|
||||||
* bundles Infima by default. Infima is a CSS framework designed to
|
|
||||||
* work well for content-centric websites.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* You can override the default Infima variables here. */
|
|
||||||
:root {
|
|
||||||
--ifm-color-primary: #25c2a0;
|
|
||||||
--ifm-color-primary-dark: rgb(33, 175, 144);
|
|
||||||
--ifm-color-primary-darker: rgb(31, 165, 136);
|
|
||||||
--ifm-color-primary-darkest: rgb(26, 136, 112);
|
|
||||||
--ifm-color-primary-light: rgb(70, 203, 174);
|
|
||||||
--ifm-color-primary-lighter: rgb(102, 212, 189);
|
|
||||||
--ifm-color-primary-lightest: rgb(146, 224, 208);
|
|
||||||
--ifm-code-font-size: 95%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.docusaurus-highlight-code-line {
|
|
||||||
background-color: rgba(0, 0, 0, 0.1);
|
|
||||||
display: block;
|
|
||||||
margin: 0 calc(-1 * var(--ifm-pre-padding));
|
|
||||||
padding: 0 var(--ifm-pre-padding);
|
|
||||||
}
|
|
||||||
|
|
||||||
html[data-theme='dark'] .docusaurus-highlight-code-line {
|
|
||||||
background-color: rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import { Redirect } from 'react-router-dom';
|
|
||||||
|
|
||||||
export default function Home() {
|
|
||||||
return <Redirect to="/docs/overview" />;
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
---
|
|
||||||
title: A hidden page
|
|
||||||
---
|
|
||||||
|
|
||||||
# Go back
|
|
||||||
|
|
||||||
How did you find me, why are you here?<br />
|
|
||||||
No, this is not an easter egg.
|
|
||||||
|
|
||||||
<!-- Thanks for reading the source code man, here's your candy 🍭 -->
|
|
|
@ -1 +0,0 @@
|
||||||
docs.llama.developomp.com
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.7 MiB |
Binary file not shown.
Before Width: | Height: | Size: 20 KiB |
Binary file not shown.
Before Width: | Height: | Size: 9.3 KiB |
Loading…
Add table
Add a link
Reference in a new issue