diff --git a/docs/pages/_meta.json b/docs/pages/_meta.json index bcf98b7..e45063e 100644 --- a/docs/pages/_meta.json +++ b/docs/pages/_meta.json @@ -1,4 +1,6 @@ { "index": "", - "installation": "" + "installation": "", + "project-structure": "", + "discordjs-essentials": "Discord.js Essentials" } diff --git a/docs/pages/discordjs-essentials.mdx b/docs/pages/discordjs-essentials.mdx new file mode 100644 index 0000000..17c5a99 --- /dev/null +++ b/docs/pages/discordjs-essentials.mdx @@ -0,0 +1,55 @@ +--- +title: "discord.js Essentials" +description: "An overview of essential discord.js features for building bot" +--- + +import { Tab, Tabs } from "nextra-theme-docs"; + +# Discord.js Essentials + +To build bot with dixt, it helps to be familiar with discord.js features such as client or shards. This page will give you a brief overview of these features. + +If you"re new to discord.js, we also recommend reffering to the [discord.js Documentation](https://discord.js.org/#/docs/main/stable/general/welcome). Here are some great resources for learning: +- [discord.js Guide](https://discordjs.guide) +- [discord.js Rapid Tutorial](https://ravbug.com/tutorials/discordjs) +- [discord.js freeCodeCamp Tutorial](https://www.freecodecamp.org/news/create-a-discord-bot-with-javascript-nodejs) + +## Client + +The client is the main interface for interacting with the Discord API, and the starting point for any bot. It is the main class in discord.js. + + + +```js +const { Client } = require("discord.js"); + +const client = new Client(); + +client.on("ready", () => { + console.log(`Logged in as ${client.user.tag}!`); +}); + +client.login("your_bot_token"); +``` + + +```js +const { default: dixt } = require("dixt"); + +const instance = new dixt({ + application: { + id: "your_application_id", + bot: { + token: "your_bot_token", + } + } +}); + +instance.client.on("ready", () => { + console.log(`Logged in as ${instance.client.user.tag}!`); +}); + +instance.start(); +``` + + diff --git a/docs/pages/project-structure.mdx b/docs/pages/project-structure.mdx new file mode 100644 index 0000000..b4cec54 --- /dev/null +++ b/docs/pages/project-structure.mdx @@ -0,0 +1,29 @@ +--- +title: "Project Structure" +description: "A list of folders and files conventions in a dixt project" +--- + +# Project Structure + +This page provides an overview of the file and folder structure of a dixt project. + +## Top-level files + +| | | +|-|-| +| **dixt** | | +| [`.env`](/installation#environment-variables) | Environment variables | +| [`.env.local`](/installation#environment-variables) | Local environment variables | +| [`.env.production`](/installation#environment-variables) | Production environment variables | +| [`.env.development`](/installation#environment-variables) | Development environment variables | +| **Ecosystem** | | +| [`package.json`](/installation#manual-installation) | Project dependencies and scripts | +| `.gitignore` | Git files and folders to ignore | +| `tsconfig.json` | Configuration file for TypeScript | +| `.eslintrc.json` | Configuration file for ESLint | + +## Top-level folders + +| | | +|-|-| +| `src` | Optional application source folder | \ No newline at end of file