diff --git a/404.html b/404.html index 43f6081..a6ad239 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.5034d55f.js b/assets/js/fb604431.5034d55f.js deleted file mode 100644 index aa3a6f8..0000000 --- a/assets/js/fb604431.5034d55f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkllama_bot_docs=self.webpackChunkllama_bot_docs||[]).push([[384],{3905:function(e,t,a){a.d(t,{Zo:function(){return c},kt:function(){return u}});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function o(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var s=n.createContext({}),p=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},c=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,i=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),m=p(a),u=r,h=m["".concat(s,".").concat(u)]||m[u]||d[u]||i;return a?n.createElement(h,o(o({ref:t},c),{},{components:a})):n.createElement(h,o({ref:t},c))}));function u(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=a.length,o=new Array(i);o[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:r,o[1]=l;for(var p=2;p/api/auth")," (example: ",(0,i.kt)("inlineCode",{parentName:"li"},"https://llama.developomp.com/api/auth"),")")))),(0,i.kt)("h3",{id:"firebase"},"Firebase"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Create a firebase project. Select one if you already have it. Using the same project usd by the bot is recommended. Make sure it is using the ",(0,i.kt)("a",{parentName:"p",href:"https://firebase.google.com/pricing"},"blaze plan")),(0,i.kt)("p",{parentName:"li"},(0,i.kt)("a",{parentName:"p",href:"https://console.firebase.google.com"},"https://console.firebase.google.com"))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Go to the ",(0,i.kt)("inlineCode",{parentName:"p"},"Firestore Database")," tab and enable it. Using production mode is highly recommended."))),(0,i.kt)("h3",{id:"local"},"Local"),(0,i.kt)("p",null,"Clone the ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/llama-bot/llama-bot-web-interface"},"llama-bot-web-interface")," repository"),(0,i.kt)("p",null,"Using HTTPS"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"git clone https://github.com/llama-bot/llama-bot-web-interface.git\n")),(0,i.kt)("p",null,"Using SSH:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"git clone git@github.com:llama-bot/llama-bot-web-interface.git\n")),(0,i.kt)("h3",{id:"functions"},"Functions"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Edit ",(0,i.kt)("inlineCode",{parentName:"p"},"functions/src/config.json"),"."),(0,i.kt)("pre",{parentName:"li"},(0,i.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,i.kt)("p",{parentName:"li"},"more info about discord OAuth2 scopes can be found in the ",(0,i.kt)("a",{parentName:"p",href:"https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes"},"discord developers documentation"))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Create ",(0,i.kt)("inlineCode",{parentName:"p"},"functions/src/secret.json")," and fill in the data."),(0,i.kt)("pre",{parentName:"li"},(0,i.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,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Go to ",(0,i.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 it to ',(0,i.kt)("inlineCode",{parentName:"p"},"firebase-adminsdk.json")," and put it in ",(0,i.kt)("inlineCode",{parentName:"p"},"functions/src/"),". This is necessary for firebase firestore database access.")),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Install firebase cli tools."),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"npm install -g firebase-tools\n"))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Select firebase project"),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"firebase use \n"))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Go to ",(0,i.kt)("inlineCode",{parentName:"p"},"functions")," directory and install necessary dependencies."),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"npm install\n"))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Build production code."),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"npm run build\n")))),(0,i.kt)("h3",{id:"frontend"},"Frontend"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Go to ",(0,i.kt)("inlineCode",{parentName:"p"},"frontend")," directory and install dependencies."),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"yarn install\n"))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Build site for production."),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"yarn build\n")))),(0,i.kt)("h3",{id:"testing"},"Testing"),(0,i.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,i.kt)("div",{parentName:"div",className:"admonition-heading"},(0,i.kt)("h5",{parentName:"div"},(0,i.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,i.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,i.kt)("path",{parentName:"svg",fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))),"info")),(0,i.kt)("div",{parentName:"div",className:"admonition-content"},(0,i.kt)("p",{parentName:"div"},"Build backend and frontend code first"))),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Start local test server by running the following command:"),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"firebase serve\n"))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Open locally served test site and log in with your discord account."),(0,i.kt)("p",{parentName:"li"},(0,i.kt)("a",{parentName:"p",href:"http://localhost:5000"},"http://localhost:5000")," ")),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"If everything is set up correctly, this should have added a new user in firestore database."))),(0,i.kt)("h3",{id:"deployment"},"Deployment"),(0,i.kt)("div",{className:"admonition admonition-warning alert alert--danger"},(0,i.kt)("div",{parentName:"div",className:"admonition-heading"},(0,i.kt)("h5",{parentName:"div"},(0,i.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,i.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},(0,i.kt)("path",{parentName:"svg",fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"}))),"warning")),(0,i.kt)("div",{parentName:"div",className:"admonition-content"},(0,i.kt)("p",{parentName:"div"},"Make sure to test your code before deploying to production"))),(0,i.kt)("p",null,"Deploying the code to production is as simple as running the following command:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"firebase deploy\n")),(0,i.kt)("p",null,"The deployment could take a while so be patient."),(0,i.kt)("p",null,"To deploy frontend code only:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"firebase deploy --only hosting\n")),(0,i.kt)("p",null,"To deploy backend code only:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"firebase deploy --only functions\n")),(0,i.kt)("h2",{id:"more-info"},"More info"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"discord developers documentation: ",(0,i.kt)("a",{parentName:"li",href:"https://discord.com/developers/docs"},"https://discord.com/developers/docs")),(0,i.kt)("li",{parentName:"ul"},"firebase admin sdk documentation: ",(0,i.kt)("a",{parentName:"li",href:"https://firebase.google.com/docs"},"https://firebase.google.com/docs"))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/fb604431.972c9068.js b/assets/js/fb604431.972c9068.js new file mode 100644 index 0000000..20c5622 --- /dev/null +++ b/assets/js/fb604431.972c9068.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkllama_bot_docs=self.webpackChunkllama_bot_docs||[]).push([[384],{3905:function(e,t,a){a.d(t,{Zo:function(){return c},kt:function(){return u}});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function o(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var s=n.createContext({}),p=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},c=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,i=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),m=p(a),u=r,h=m["".concat(s,".").concat(u)]||m[u]||d[u]||i;return a?n.createElement(h,o(o({ref:t},c),{},{components:a})):n.createElement(h,o({ref:t},c))}));function u(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=a.length,o=new Array(i);o[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:r,o[1]=l;for(var p=2;p/api/auth")," (e.g. ",(0,i.kt)("inlineCode",{parentName:"li"},"https://llama.developomp.com/api/auth"),")")))),(0,i.kt)("h3",{id:"firebase"},"Firebase"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("a",{parentName:"li",href:"https://console.firebase.google.com"},"Create")," a firebase project. Select one if you already have it. Using the same project usd by the bot is recommended. Make sure it is using the ",(0,i.kt)("a",{parentName:"li",href:"https://firebase.google.com/pricing"},"blaze plan"),"."),(0,i.kt)("li",{parentName:"ol"},"Go to the ",(0,i.kt)("inlineCode",{parentName:"li"},"Firestore Database")," tab and enable it. Usage of production mode is highly recommended.")),(0,i.kt)("h3",{id:"local"},"Local"),(0,i.kt)("p",null,"Clone the ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/llama-bot/llama-bot-web-interface"},"llama-bot-web-interface")," repository."),(0,i.kt)("h3",{id:"functions"},"Functions"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Edit ",(0,i.kt)("inlineCode",{parentName:"p"},"functions/src/config.json"),"."),(0,i.kt)("pre",{parentName:"li"},(0,i.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,i.kt)("p",{parentName:"li"},"more info about discord OAuth2 scopes can be found in the ",(0,i.kt)("a",{parentName:"p",href:"https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes"},"discord developers documentation"))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Create ",(0,i.kt)("inlineCode",{parentName:"p"},"functions/src/secret.json")," and fill in the data."),(0,i.kt)("pre",{parentName:"li"},(0,i.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,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Visit ",(0,i.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 it to ',(0,i.kt)("inlineCode",{parentName:"p"},"firebase-adminsdk.json")," and put it in ",(0,i.kt)("inlineCode",{parentName:"p"},"functions/src/"),".")),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Install firebase cli tools."),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"yarn global add firebase-tools\n"))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Select firebase project. You may have to log in. You must run this command in the project root."),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"firebase use \n"))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Go to ",(0,i.kt)("inlineCode",{parentName:"p"},"functions")," directory and install necessary dependencies."),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"yarn install\n"))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Build production code."),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"yarn build\n")))),(0,i.kt)("h3",{id:"frontend"},"Frontend"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Go to the ",(0,i.kt)("inlineCode",{parentName:"p"},"frontend")," directory and install dependencies."),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"yarn install\n"))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Test with hot reloading."),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"yarn dev\n"))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Build site for production."),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"yarn build\n"))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Preview the production build"),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"yarn preview\n")))),(0,i.kt)("h3",{id:"testing"},"Testing"),(0,i.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,i.kt)("div",{parentName:"div",className:"admonition-heading"},(0,i.kt)("h5",{parentName:"div"},(0,i.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,i.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,i.kt)("path",{parentName:"svg",fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))),"info")),(0,i.kt)("div",{parentName:"div",className:"admonition-content"},(0,i.kt)("p",{parentName:"div"},"Build backend and frontend code first"))),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Start local test server by running the following command:"),(0,i.kt)("pre",{parentName:"li"},(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"firebase serve\n"))),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"Open locally served test site and log in with your discord account."),(0,i.kt)("p",{parentName:"li"},(0,i.kt)("a",{parentName:"p",href:"http://localhost:5000"},"http://localhost:5000")," ")),(0,i.kt)("li",{parentName:"ol"},(0,i.kt)("p",{parentName:"li"},"If everything is set up correctly, this should have added a new user in firestore database."))),(0,i.kt)("h3",{id:"deployment"},"Deployment"),(0,i.kt)("div",{className:"admonition admonition-warning alert alert--danger"},(0,i.kt)("div",{parentName:"div",className:"admonition-heading"},(0,i.kt)("h5",{parentName:"div"},(0,i.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,i.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},(0,i.kt)("path",{parentName:"svg",fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"}))),"warning")),(0,i.kt)("div",{parentName:"div",className:"admonition-content"},(0,i.kt)("p",{parentName:"div"},"Make sure to test your code before deploying to production"))),(0,i.kt)("p",null,"Deploying the code to production is as simple as running the following command:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"firebase deploy\n")),(0,i.kt)("p",null,"The deployment could take a while so be patient."),(0,i.kt)("p",null,"To deploy frontend code only:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"firebase deploy --only hosting\n")),(0,i.kt)("p",null,"To deploy backend code only:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-bash"},"firebase deploy --only functions\n")),(0,i.kt)("h2",{id:"more-info"},"More info"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"discord developers documentation: ",(0,i.kt)("a",{parentName:"li",href:"https://discord.com/developers/docs"},"https://discord.com/developers/docs")),(0,i.kt)("li",{parentName:"ul"},"firebase admin sdk documentation: ",(0,i.kt)("a",{parentName:"li",href:"https://firebase.google.com/docs"},"https://firebase.google.com/docs"))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.92268c6e.js b/assets/js/runtime~main.0e16f680.js similarity index 98% rename from assets/js/runtime~main.92268c6e.js rename to assets/js/runtime~main.0e16f680.js index 3dcc881..eb2f70f 100644 --- a/assets/js/runtime~main.92268c6e.js +++ b/assets/js/runtime~main.0e16f680.js @@ -1 +1 @@ -!function(){"use strict";var e,t,n,r,o,c={},f={};function u(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,u),n.loaded=!0,n.exports}u.m=c,u.c=f,e=[],u.O=function(t,n,r,o){if(!n){var c=1/0;for(d=0;d=o)&&Object.keys(u.O).every((function(e){return u.O[e](n[a])}))?n.splice(a--,1):(f=!1,o0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,r,o]},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},u.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);u.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},u.d(o,c),o},u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.f={},u.e=function(e){return Promise.all(Object.keys(u.f).reduce((function(t,n){return u.f[n](e,t),t}),[]))},u.u=function(e){return"assets/js/"+({53:"935f2afb",85:"1f391b9e",121:"55960ee5",203:"cc530f52",384:"fb604431",477:"b2f554cd",485:"1185c21a",514:"1be78505",544:"611e23df",567:"1dec2e7b",576:"6ec7341c",586:"8ba27f22",608:"9e4087bc",685:"8c4d310d",751:"3720c009",774:"bb3131ce",903:"2daae186",918:"17896441",994:"d6526129"}[e]||e)+"."+{53:"6af7b197",75:"82a15ceb",85:"4764cafc",121:"5b812ed6",159:"577cedc0",203:"c66fb58a",374:"18f0b4b5",384:"5034d55f",477:"8922f3da",485:"1e6142bd",514:"516e871c",544:"a9438f71",567:"7b0d2bbf",576:"c8db2622",586:"d500ac68",608:"f921e43e",685:"72cc3ef0",698:"d853c79f",751:"f4540c7e",774:"a16d5343",903:"8fb9964b",918:"e470ae12",994:"966ca83d"}[e]+".js"},u.miniCssF=function(e){return"assets/css/styles.6d09dbb1.css"},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="llama-bot-docs:",u.l=function(e,t,n,c){if(r[e])r[e].push(t);else{var f,a;if(void 0!==n)for(var i=document.getElementsByTagName("script"),d=0;d=o)&&Object.keys(u.O).every((function(e){return u.O[e](n[a])}))?n.splice(a--,1):(f=!1,o0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,r,o]},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},u.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);u.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},u.d(o,c),o},u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.f={},u.e=function(e){return Promise.all(Object.keys(u.f).reduce((function(t,n){return u.f[n](e,t),t}),[]))},u.u=function(e){return"assets/js/"+({53:"935f2afb",85:"1f391b9e",121:"55960ee5",203:"cc530f52",384:"fb604431",477:"b2f554cd",485:"1185c21a",514:"1be78505",544:"611e23df",567:"1dec2e7b",576:"6ec7341c",586:"8ba27f22",608:"9e4087bc",685:"8c4d310d",751:"3720c009",774:"bb3131ce",903:"2daae186",918:"17896441",994:"d6526129"}[e]||e)+"."+{53:"6af7b197",75:"82a15ceb",85:"4764cafc",121:"5b812ed6",159:"577cedc0",203:"c66fb58a",374:"18f0b4b5",384:"972c9068",477:"8922f3da",485:"1e6142bd",514:"516e871c",544:"a9438f71",567:"7b0d2bbf",576:"c8db2622",586:"d500ac68",608:"f921e43e",685:"72cc3ef0",698:"d853c79f",751:"f4540c7e",774:"a16d5343",903:"8fb9964b",918:"e470ae12",994:"966ca83d"}[e]+".js"},u.miniCssF=function(e){return"assets/css/styles.6d09dbb1.css"},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="llama-bot-docs:",u.l=function(e,t,n,c){if(r[e])r[e].push(t);else{var f,a;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 b182d99..a33598d 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 a64fe37..280aaff 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_HERETESTING=true # set it to false on productionPREFIX_PROD=PUT_PRODUCTION_DEFAULT_PREFIX_HEREPREFIX_DEV=PUT_DEVELOPMENT_DEFAULT_PREFIX_HEREOWNER_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 2718ed1..afa670a 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 0fbe1f2..02655d0 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 658ed10..131ab10 100644 --- a/docs/overview.html +++ b/docs/overview.html @@ -5,14 +5,14 @@ Overview | Llama Bot Documentation - +

Overview

warning

The Llama Bot is under heavy development. It can not even be called unstable. Most of the features are not written yet.

info

The target audience of this documentation are developers.
If you are a user and want to learn how to use the bot, go to the Usage section.

If you have a question or a suggestion, feel free to open a issue on the appropriate repository.

Repositories#

llama-bot#

The discord bot itself.

llama-bot-web-interface#

Backend and frontend code for http api and website.

llama-bot-docs#

Documentation for all llama bot related projects. You are reading it right now.

Special thanks#

  • Dabidoo#9888 (265697563280146433) for making the colored bot logo
  • SษชสŸแด‹ Sแด˜ษชแด…แด‡ส€#8364 (419184817368858644) for making the white bot logo
- + \ No newline at end of file diff --git a/docs/tags.html b/docs/tags.html index 69a02e0..923b8fa 100644 --- a/docs/tags.html +++ b/docs/tags.html @@ -5,13 +5,13 @@ Tags | Llama Bot Documentation - +

Tags

- + \ No newline at end of file diff --git a/docs/usage/commands.html b/docs/usage/commands.html index c50dfec..639a7c1 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 b07ab78..18907f2 100644 --- a/docs/usage/overview.html +++ b/docs/usage/overview.html @@ -5,13 +5,13 @@ Overview | Llama Bot Documentation - +

Overview

Work in progress...

Explain:

  • what bots are
  • what commands are
    • what prefixes are
      • ping prefix
      • default prefix
      • how different servers can have different prefixes

How to read documentation#

Arguments are extra information that are passed with the command. A command can have any number arguments and they could either be required or optional.

Searching#

Commands#

Required arguments#

Optional arguments#

Examples#

  • command <arg1>: a required argument
  • command <arg1> [arg2]: a required argument and a optional one
  • command [args]*: arbitrary amount of optional arguments
  • command [<arg1> <arg2>]: neither or both
- + \ No newline at end of file diff --git a/docs/web-interface/api.html b/docs/web-interface/api.html index 2f71a63..32bc4a4 100644 --- a/docs/web-interface/api.html +++ b/docs/web-interface/api.html @@ -5,13 +5,13 @@ API | Llama Bot Documentation - +

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

- + \ No newline at end of file diff --git a/docs/web-interface/overview.html b/docs/web-interface/overview.html index 33bfc26..9b26cea 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 9e313e8..cab6f1e 100644 --- a/docs/web-interface/setting-up.html +++ b/docs/web-interface/setting-up.html @@ -5,13 +5,13 @@ 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
  • npm & yarn (npm is included in node.js)
  • Discord account
  • Google Firebase 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. Using the same application used by the discord bot is recommended.

  2. Go to the OAuth2 tab.

  3. Add the following redirects:

    • testing (http): http://localhost:5000/api/auth
    • production (https): https://<YOUR_SITE_NAME_HERE>/api/auth (example: https://llama.developomp.com/api/auth)

Firebase#

  1. Create a firebase project. Select one if you already have it. Using the same project usd by the bot is recommended. Make sure it is using the blaze plan

    https://console.firebase.google.com

  2. Go to the Firestore Database tab and enable it. Using production mode is highly recommended.

Local#

Clone the llama-bot-web-interface repository

Using HTTPS

git clone https://github.com/llama-bot/llama-bot-web-interface.git

Using SSH:

git clone git@github.com:llama-bot/llama-bot-web-interface.git

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 and fill in the data.

    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. Go to this link, select your firebase project and download the firebase admin sdk key by pressing the "Generate new private key" button. Rename it to firebase-adminsdk.json and put it in functions/src/. This is necessary for firebase firestore database access.

  4. Install firebase cli tools.

    npm install -g firebase-tools
  5. Select firebase project

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

    npm install
  7. Build production code.

    npm run build

Frontend#

  1. Go to frontend directory and install dependencies.

    yarn install
  2. Build site for production.

    yarn build

Testing#

info

Build backend and frontend code first

  1. Start local test server by running the following command:

    firebase serve
  2. Open locally served test site and log in with your discord account.

    http://localhost:5000

  3. If everything is set up correctly, this should have added a new user in firestore database.

Deployment#

warning

Make sure to test your code before deploying to production

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

firebase deploy

The deployment could take a while so be patient.

To deploy frontend code only:

firebase deploy --only hosting

To deploy 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 Firebase 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. Using the same application used by the discord bot is recommended.

  2. Go to the 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. Using the same project usd by the bot is recommended. 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 and fill in the data.

    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 it to firebase-adminsdk.json and put it in functions/src/.

  4. Install firebase cli tools.

    yarn global add firebase-tools
  5. Select firebase project. You may have to log in. You must run this command in the project root.

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

    yarn install
  7. Build production code.

    yarn build

Frontend#

  1. Go to the frontend directory and install 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#

info

Build backend and frontend code first

  1. Start local test server by running the following command:

    firebase serve
  2. Open locally served test site and log in with your discord account.

    http://localhost:5000

  3. If everything is set up correctly, this should have added a new user in firestore database.

Deployment#

warning

Make sure to test your code before deploying to production

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

firebase deploy

The deployment could take a while so be patient.

To deploy frontend code only:

firebase deploy --only hosting

To deploy backend code only:

firebase deploy --only functions

More info#

+ \ No newline at end of file diff --git a/secret.html b/secret.html index b2d33a1..be2dc35 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