diff --git a/404.html b/404.html index 3de5c16..560446f 100644 --- a/404.html +++ b/404.html @@ -5,13 +5,13 @@ Page Not Found | Llama Bot Documentation - +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/assets/js/fb604431.921e7f7a.js b/assets/js/fb604431.921e7f7a.js new file mode 100644 index 0000000..9faa0f4 --- /dev/null +++ b/assets/js/fb604431.921e7f7a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkllama_bot_docs=self.webpackChunkllama_bot_docs||[]).push([[384],{3905:function(e,t,n){n.d(t,{Zo:function(){return c},kt:function(){return m}});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var p=a.createContext({}),s=function(e){var t=a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},c=function(e){var t=s(e.components);return a.createElement(p.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,p=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=s(n),m=r,h=u["".concat(p,".").concat(m)]||u[m]||d[m]||o;return n?a.createElement(h,i(i({ref:t},c),{},{components:n})):a.createElement(h,i({ref:t},c))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=u;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l.mdxType="string"==typeof e?e:r,i[1]=l;for(var s=2;s/api/auth")," (e.g. ",(0,o.kt)("inlineCode",{parentName:"li"},"https://llama.developomp.com/api/auth"),")")))),(0,o.kt)("h3",{id:"firebase"},"Firebase"),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("a",{parentName:"li",href:"https://console.firebase.google.com"},"Create")," 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 ",(0,o.kt)("a",{parentName:"li",href:"https://firebase.google.com/pricing"},"blaze plan"),"."),(0,o.kt)("li",{parentName:"ol"},"Go to the ",(0,o.kt)("inlineCode",{parentName:"li"},"Firestore Database")," tab and enable it. Usage of production mode is highly recommended.")),(0,o.kt)("h3",{id:"local"},"Local"),(0,o.kt)("p",null,"Clone the ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/llama-bot/llama-bot-web-interface"},"llama-bot-web-interface")," repository."),(0,o.kt)("h3",{id:"functions"},"Functions"),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Edit ",(0,o.kt)("inlineCode",{parentName:"p"},"functions/src/config.json"),"."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-json",metastring:'title="functions/src/config.json (default values)"',title:'"functions/src/config.json',"(default":!0,'values)"':!0},'{\n "pathPrefix": "/api", // where the API endpoints will be located. Set it to "/" if it\'s on another domain (example: api.example.com)\n "scopes": ["identify", "email", "guilds"] // Discord OAuth2 scopes.\n}\n')),(0,o.kt)("p",{parentName:"li"},"more info about discord OAuth2 scopes can be found in the ",(0,o.kt)("a",{parentName:"p",href:"https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes"},"discord developers documentation"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Create ",(0,o.kt)("inlineCode",{parentName:"p"},"functions/src/secret.json"),"."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-json",metastring:'title="functions/src/secret.json"',title:'"functions/src/secret.json"'},'{\n "clientID": "DISCORD_CLIENT_ID_HERE", // Discord OAuth2 Client ID\n "clientSecret": "DISCORD_CLIENT_SECRET_HERE", // Discord OAuth2 Client Secret\n "secret": "SECRET_COOKIE_KEY_HERE" // secret key to be used for express session security\n}\n'))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Visit ",(0,o.kt)("a",{parentName:"p",href:"https://console.firebase.google.com/project/_/settings/serviceaccounts/adminsdk"},"this link"),', select your firebase project and download the firebase admin sdk key by pressing the "Generate new private key" button. Rename the downloaded file to ',(0,o.kt)("inlineCode",{parentName:"p"},"firebase-adminsdk.json")," and put it in the ",(0,o.kt)("inlineCode",{parentName:"p"},"functions/src/")," directory.")),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Install firebase tools."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"yarn global add firebase-tools\n"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Select your firebase project. You must run this command in the project root."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"firebase use \n"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Go to the ",(0,o.kt)("inlineCode",{parentName:"p"},"functions")," directory and install the dependencies."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"yarn install\n"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Build production code."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"yarn build\n")))),(0,o.kt)("h3",{id:"frontend"},"Frontend"),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Go to the ",(0,o.kt)("inlineCode",{parentName:"p"},"frontend")," directory and install the dependencies."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"yarn install\n"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Test with hot reloading."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"yarn dev\n"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Build site for production."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"yarn build\n"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Preview the production build"),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"yarn preview\n")))),(0,o.kt)("h3",{id:"testing"},"Testing"),(0,o.kt)("p",null,"After building the backend and the frontend code, run the following command to start a local test server:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"firebase serve\n")),(0,o.kt)("h3",{id:"deployment"},"Deployment"),(0,o.kt)("p",null,"Deploying the code to production is as simple as running the following command:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"firebase deploy\n")),(0,o.kt)("p",null,"The deployment could take a while so be patient."),(0,o.kt)("p",null,"Deploying frontend code only:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"firebase deploy --only hosting\n")),(0,o.kt)("p",null,"Deploying backend code only:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"firebase deploy --only functions\n")),(0,o.kt)("h3",{id:"automated-deployment"},"Automated deployment"),(0,o.kt)("p",null,"If you are using github, you can easily automate the deployment process.\nThe web interface repository is configured to use ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/features/actions"},"Github action")," to automatically deploy changes made to the ",(0,o.kt)("inlineCode",{parentName:"p"},"master")," branch.\nWe recommend you do the development in the ",(0,o.kt)("inlineCode",{parentName:"p"},"dev")," branch and put production code in the ",(0,o.kt)("inlineCode",{parentName:"p"},"master")," branch."),(0,o.kt)("p",null,"Go to repository Settings > Secrets (side bar) > Actions (dropdown)",(0,o.kt)("br",null),"\nand create the following secrets by clicking the New repository secret button."),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"FIREBASE_TOKEN"))),(0,o.kt)("p",null,"You can get this by running the following command:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"firebase login:ci\n")),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("inlineCode",{parentName:"li"},"FIREBASE_PROJECT"))),(0,o.kt)("p",null,"This is the firebase project ID you are using. It should be inside the ",(0,o.kt)("inlineCode",{parentName:"p"},".firebaserc")," file."),(0,o.kt)("h2",{id:"more-info"},"More info"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://discord.com/developers/docs"},"discord developers documentation")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://firebase.google.com/docs"},"firebase admin sdk documentation")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://firebase.google.com/docs/functions/typescript"},"firebase functions documentation"))))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/fb604431.f0a6c676.js b/assets/js/fb604431.f0a6c676.js deleted file mode 100644 index 7928108..0000000 --- a/assets/js/fb604431.f0a6c676.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkllama_bot_docs=self.webpackChunkllama_bot_docs||[]).push([[384],{3905:function(e,t,n){n.d(t,{Zo:function(){return c},kt:function(){return m}});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var p=a.createContext({}),s=function(e){var t=a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},c=function(e){var t=s(e.components);return a.createElement(p.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,p=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=s(n),m=r,f=u["".concat(p,".").concat(m)]||u[m]||d[m]||o;return n?a.createElement(f,i(i({ref:t},c),{},{components:n})):a.createElement(f,i({ref:t},c))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=u;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l.mdxType="string"==typeof e?e:r,i[1]=l;for(var s=2;s/api/auth")," (e.g. ",(0,o.kt)("inlineCode",{parentName:"li"},"https://llama.developomp.com/api/auth"),")")))),(0,o.kt)("h3",{id:"firebase"},"Firebase"),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("a",{parentName:"li",href:"https://console.firebase.google.com"},"Create")," 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 ",(0,o.kt)("a",{parentName:"li",href:"https://firebase.google.com/pricing"},"blaze plan"),"."),(0,o.kt)("li",{parentName:"ol"},"Go to the ",(0,o.kt)("inlineCode",{parentName:"li"},"Firestore Database")," tab and enable it. Usage of production mode is highly recommended.")),(0,o.kt)("h3",{id:"local"},"Local"),(0,o.kt)("p",null,"Clone the ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/llama-bot/llama-bot-web-interface"},"llama-bot-web-interface")," repository."),(0,o.kt)("h3",{id:"functions"},"Functions"),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Edit ",(0,o.kt)("inlineCode",{parentName:"p"},"functions/src/config.json"),"."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-json",metastring:'title="functions/src/config.json (default values)"',title:'"functions/src/config.json',"(default":!0,'values)"':!0},'{\n "pathPrefix": "/api", // where the API endpoints will be located. Set it to "/" if it\'s on another domain (example: api.example.com)\n "scopes": ["identify", "email", "guilds"] // Discord OAuth2 scopes.\n}\n')),(0,o.kt)("p",{parentName:"li"},"more info about discord OAuth2 scopes can be found in the ",(0,o.kt)("a",{parentName:"p",href:"https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes"},"discord developers documentation"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Create ",(0,o.kt)("inlineCode",{parentName:"p"},"functions/src/secret.json"),"."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-json",metastring:'title="functions/src/secret.json"',title:'"functions/src/secret.json"'},'{\n "clientID": "DISCORD_CLIENT_ID_HERE", // Discord OAuth2 Client ID\n "clientSecret": "DISCORD_CLIENT_SECRET_HERE", // Discord OAuth2 Client Secret\n "secret": "SECRET_COOKIE_KEY_HERE" // secret key to be used for express session security\n}\n'))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Visit ",(0,o.kt)("a",{parentName:"p",href:"https://console.firebase.google.com/project/_/settings/serviceaccounts/adminsdk"},"this link"),', select your firebase project and download the firebase admin sdk key by pressing the "Generate new private key" button. Rename the downloaded file to ',(0,o.kt)("inlineCode",{parentName:"p"},"firebase-adminsdk.json")," and put it in the ",(0,o.kt)("inlineCode",{parentName:"p"},"functions/src/")," directory.")),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Install firebase tools."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"yarn global add firebase-tools\n"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Select your firebase project. You must run this command in the project root."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"firebase use \n"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Go to the ",(0,o.kt)("inlineCode",{parentName:"p"},"functions")," directory and install the dependencies."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"yarn install\n"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Build production code."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"yarn build\n")))),(0,o.kt)("h3",{id:"frontend"},"Frontend"),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Go to the ",(0,o.kt)("inlineCode",{parentName:"p"},"frontend")," directory and install the dependencies."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"yarn install\n"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Test with hot reloading."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"yarn dev\n"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Build site for production."),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"yarn build\n"))),(0,o.kt)("li",{parentName:"ol"},(0,o.kt)("p",{parentName:"li"},"Preview the production build"),(0,o.kt)("pre",{parentName:"li"},(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"yarn preview\n")))),(0,o.kt)("h3",{id:"testing"},"Testing"),(0,o.kt)("p",null,"After building the backend and the frontend code, run the following command to start a local test server:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"firebase serve\n")),(0,o.kt)("h3",{id:"deployment"},"Deployment"),(0,o.kt)("p",null,"Deploying the code to production is as simple as running the following command:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"firebase deploy\n")),(0,o.kt)("p",null,"The deployment could take a while so be patient."),(0,o.kt)("p",null,"Deploying frontend code only:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"firebase deploy --only hosting\n")),(0,o.kt)("p",null,"Deploying backend code only:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-bash"},"firebase deploy --only functions\n")),(0,o.kt)("h2",{id:"more-info"},"More info"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://discord.com/developers/docs"},"discord developers documentation")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://firebase.google.com/docs"},"firebase admin sdk documentation")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://firebase.google.com/docs/functions/typescript"},"firebase functions documentation"))))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.3169a026.js b/assets/js/runtime~main.9fadb4c0.js similarity index 98% rename from assets/js/runtime~main.3169a026.js rename to assets/js/runtime~main.9fadb4c0.js index e39387b..54bbd92 100644 --- a/assets/js/runtime~main.3169a026.js +++ b/assets/js/runtime~main.9fadb4c0.js @@ -1 +1 @@ -!function(){"use strict";var e,t,n,r,o,c={},f={};function a(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={id:e,loaded:!1,exports:{}};return c[e].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.m=c,a.c=f,e=[],a.O=function(t,n,r,o){if(!n){var c=1/0;for(d=0;d=o)&&Object.keys(a.O).every((function(e){return a.O[e](n[u])}))?n.splice(u--,1):(f=!1,o0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,r,o]},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},a.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var o=Object.create(null);a.r(o);var c={};t=t||[null,n({}),n([]),n(n)];for(var f=2&r&&e;"object"==typeof f&&!~t.indexOf(f);f=n(f))Object.getOwnPropertyNames(f).forEach((function(t){c[t]=function(){return e[t]}}));return c.default=function(){return e},a.d(o,c),o},a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=function(e){return Promise.all(Object.keys(a.f).reduce((function(t,n){return a.f[n](e,t),t}),[]))},a.u=function(e){return"assets/js/"+({53:"935f2afb",85:"1f391b9e",203:"cc530f52",237:"1df93b7f",384:"fb604431",477:"b2f554cd",485:"1185c21a",514:"1be78505",544:"611e23df",567:"1dec2e7b",576:"6ec7341c",586:"8ba27f22",608:"9e4087bc",685:"8c4d310d",774:"bb3131ce",903:"2daae186",918:"17896441",994:"d6526129"}[e]||e)+"."+{53:"8e9f14b4",75:"d0062eba",85:"cec1b863",203:"9eef22be",237:"6a1c5ee4",384:"f0a6c676",477:"69b650e4",485:"7836e536",514:"a222ddd6",544:"a5fe5bad",567:"d6b7d369",576:"ba6f504f",586:"784ee771",608:"c1addae9",685:"0a0ad687",774:"a17d0b48",903:"1c4fd7f1",918:"2cd8a476",938:"22cb5172",994:"dffc6c2b"}[e]+".js"},a.miniCssF=function(e){return"assets/css/styles.c1c17b9a.css"},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="llama-bot-docs:",a.l=function(e,t,n,c){if(r[e])r[e].push(t);else{var f,u;if(void 0!==n)for(var i=document.getElementsByTagName("script"),d=0;d=o)&&Object.keys(a.O).every((function(e){return a.O[e](n[u])}))?n.splice(u--,1):(f=!1,o0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,r,o]},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},a.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var o=Object.create(null);a.r(o);var c={};t=t||[null,n({}),n([]),n(n)];for(var f=2&r&&e;"object"==typeof f&&!~t.indexOf(f);f=n(f))Object.getOwnPropertyNames(f).forEach((function(t){c[t]=function(){return e[t]}}));return c.default=function(){return e},a.d(o,c),o},a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=function(e){return Promise.all(Object.keys(a.f).reduce((function(t,n){return a.f[n](e,t),t}),[]))},a.u=function(e){return"assets/js/"+({53:"935f2afb",85:"1f391b9e",203:"cc530f52",237:"1df93b7f",384:"fb604431",477:"b2f554cd",485:"1185c21a",514:"1be78505",544:"611e23df",567:"1dec2e7b",576:"6ec7341c",586:"8ba27f22",608:"9e4087bc",685:"8c4d310d",774:"bb3131ce",903:"2daae186",918:"17896441",994:"d6526129"}[e]||e)+"."+{53:"8e9f14b4",75:"d0062eba",85:"cec1b863",203:"9eef22be",237:"6a1c5ee4",384:"921e7f7a",477:"69b650e4",485:"7836e536",514:"a222ddd6",544:"a5fe5bad",567:"d6b7d369",576:"ba6f504f",586:"784ee771",608:"c1addae9",685:"0a0ad687",774:"a17d0b48",903:"1c4fd7f1",918:"2cd8a476",938:"22cb5172",994:"dffc6c2b"}[e]+".js"},a.miniCssF=function(e){return"assets/css/styles.c1c17b9a.css"},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="llama-bot-docs:",a.l=function(e,t,n,c){if(r[e])r[e].push(t);else{var f,u;if(void 0!==n)for(var i=document.getElementsByTagName("script"),d=0;d Archive | Llama Bot Documentation - +

Archive

Archive

- + \ No newline at end of file diff --git a/docs/bot/overview.html b/docs/bot/overview.html index e5a5532..5e674b1 100644 --- a/docs/bot/overview.html +++ b/docs/bot/overview.html @@ -5,14 +5,14 @@ Overview | Llama Bot Documentation - +

Overview

Why Llama Bot?​

102% Free​

Every features are available for free.

Everything is funded via donation.

Open source​

Llama bot is not just free as in free ice cream, but also free as in freedom. Every code that powers the Llama Bot can be found on Github. Developers have the first class support and we provide detailed documentations to help you host the Llama Bot yourself.

Also, every part of the bot is licensed under the MIT License so you are free to do whatever your hart desires!

- + \ No newline at end of file diff --git a/docs/bot/setting-up.html b/docs/bot/setting-up.html index 1379215..360c9b8 100644 --- a/docs/bot/setting-up.html +++ b/docs/bot/setting-up.html @@ -5,13 +5,13 @@ Setting up | Llama Bot Documentation - +

Setting up

info

This documentation uses the dev branch (javascript) instead of the master branch (python).

In this documentation, you will learn how to set up the llama discord bot.

Steps​

Pre-requirements​

  • Node.js 16.6.0+
  • yarn
  • 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. 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 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 the service account key. This will be used during the Server setup.

Server​

info

Assumes UNIX-like environment (Linux, BSD, Mac, etc.)

  1. Clone the llama bot repository and open it.

    git clone https://github.com/llama-bot/llama-bot.git
    cd llama-bot
  2. Install dependencies.

    yarn install
  3. Create .env file in the project root and put the discord bot token generated during the Discord setup.

    .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 setup to firebase-adminsdk.json, and put it in the secret directory.

  5. Build the bot.

    yarn build
  6. Install pm2 globally.

    yarn global add pm2
  7. Start the bot.

    pm2 start build/index.js --watch --name "Llama Bot"
    OptionExplanation
    --watchAuto 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.

    pm2 startup

More info​

- + \ No newline at end of file diff --git a/docs/docs/overview.html b/docs/docs/overview.html index 762c596..fb7c4d1 100644 --- a/docs/docs/overview.html +++ b/docs/docs/overview.html @@ -5,13 +5,13 @@ Overview | Llama Bot Documentation - + - + \ No newline at end of file diff --git a/docs/docs/setting-up.html b/docs/docs/setting-up.html index a62bebc..c7435fe 100644 --- a/docs/docs/setting-up.html +++ b/docs/docs/setting-up.html @@ -5,13 +5,13 @@ Setting Up | Llama Bot Documentation - +
- + \ No newline at end of file diff --git a/docs/overview.html b/docs/overview.html index 4292883..66dbcae 100644 --- a/docs/overview.html +++ b/docs/overview.html @@ -5,7 +5,7 @@ Overview | Llama Bot Documentation - + @@ -14,7 +14,7 @@ It can not even be called unstable. Most of the features are not written yet.

The Llama bot is a discord bot made for the LP community discord server.
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.
However, since the source code is available on github, 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:

If you think you are ready to setup the bot yourself, head over to the following pages:

Special thanks​

  • Dabidoo#9888 (265697563280146433) for making the colored logo
  • Sɪʟᴋ Sᴘɪᴅᴇʀ#8364 (419184817368858644) for making the white logo
- + \ No newline at end of file diff --git a/docs/usage/commands.html b/docs/usage/commands.html index e2f4231..12b4b51 100644 --- a/docs/usage/commands.html +++ b/docs/usage/commands.html @@ -5,13 +5,13 @@ Commands | Llama Bot Documentation - +

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.

example image of bot usage

help <category>​

help <command>​

ping​

- + \ No newline at end of file diff --git a/docs/usage/overview.html b/docs/usage/overview.html index 5945b07..7902a84 100644 --- a/docs/usage/overview.html +++ b/docs/usage/overview.html @@ -5,7 +5,7 @@ Overview | Llama Bot Documentation - + @@ -21,7 +21,7 @@ This is why you need arguments.

Here's an example of a command with a 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

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>]
- + \ No newline at end of file diff --git a/docs/web-interface/api.html b/docs/web-interface/api.html index a52dd25..4ecae62 100644 --- a/docs/web-interface/api.html +++ b/docs/web-interface/api.html @@ -5,13 +5,13 @@ API | Llama Bot Documentation - +
- + \ No newline at end of file diff --git a/docs/web-interface/overview.html b/docs/web-interface/overview.html index 8e1ddc0..b73b615 100644 --- a/docs/web-interface/overview.html +++ b/docs/web-interface/overview.html @@ -5,13 +5,13 @@ Overview | Llama Bot Documentation - +
- + \ No newline at end of file diff --git a/docs/web-interface/setting-up.html b/docs/web-interface/setting-up.html index 4b4f2d0..f2dd235 100644 --- a/docs/web-interface/setting-up.html +++ b/docs/web-interface/setting-up.html @@ -5,13 +5,16 @@ Setting up | Llama Bot Documentation - +
-

Setting up

This page will teach you how to set up the 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)

Discord​

  1. Go to the Discord Developer Portal 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 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.
  2. Go to the Firestore Database tab and enable it. Usage of production mode is highly recommended.

Local​

Clone the llama-bot-web-interface repository.

Functions​

  1. Edit functions/src/config.json.

    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

  2. Create functions/src/secret.json.

    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, 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.

    yarn global add firebase-tools
  5. Select your firebase project. You must run this command in the project root.

    firebase use <FIREBASE_PROJECT_ID_HERE>
  6. Go to the functions directory and install the dependencies.

    yarn install
  7. Build production code.

    yarn build

Frontend​

  1. Go to the frontend directory and install the dependencies.

    yarn install
  2. Test with hot reloading.

    yarn dev
  3. Build site for production.

    yarn build
  4. Preview the production build

    yarn preview

Testing​

After building the backend and the frontend code, run the following command to start a local test server:

firebase serve

Deployment​

Deploying the code to production is as simple as running the following command:

firebase deploy

The deployment could take a while so be patient.

Deploying frontend code only:

firebase deploy --only hosting

Deploying backend code only:

firebase deploy --only functions

More info​

- +

Setting up

This page will teach you how to set up the 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)

Discord​

  1. Go to the Discord Developer Portal 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 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.
  2. Go to the Firestore Database tab and enable it. Usage of production mode is highly recommended.

Local​

Clone the llama-bot-web-interface repository.

Functions​

  1. Edit functions/src/config.json.

    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

  2. Create functions/src/secret.json.

    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, 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.

    yarn global add firebase-tools
  5. Select your firebase project. You must run this command in the project root.

    firebase use <FIREBASE_PROJECT_ID_HERE>
  6. Go to the functions directory and install the dependencies.

    yarn install
  7. Build production code.

    yarn build

Frontend​

  1. Go to the frontend directory and install the dependencies.

    yarn install
  2. Test with hot reloading.

    yarn dev
  3. Build site for production.

    yarn build
  4. Preview the production build

    yarn preview

Testing​

After building the backend and the frontend code, run the following command to start a local test server:

firebase serve

Deployment​

Deploying the code to production is as simple as running the following command:

firebase deploy

The deployment could take a while so be patient.

Deploying frontend code only:

firebase deploy --only hosting

Deploying backend code only:

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 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)
+and create the following secrets by clicking the New repository secret button.

  • FIREBASE_TOKEN

You can get this by running the following command:

firebase login:ci
  • FIREBASE_PROJECT

This is the firebase project ID you are using. It should be inside the .firebaserc file.

More info​

+ \ No newline at end of file diff --git a/index.html b/index.html index 5aced33..21b2c4f 100644 --- a/index.html +++ b/index.html @@ -5,13 +5,13 @@ - +
- + \ No newline at end of file diff --git a/secret.html b/secret.html index 97bc239..2e459c9 100644 --- a/secret.html +++ b/secret.html @@ -5,14 +5,14 @@ A hidden page | Llama Bot Documentation - +

Go back

How did you find me, why are you here?
No, this is not an easter egg.

- + \ No newline at end of file