Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch 1 #148

Closed
wants to merge 5 commits into from
Closed

Patch 1 #148

wants to merge 5 commits into from

Conversation

GuynnR
Copy link
Contributor

@GuynnR GuynnR commented Dec 30, 2023

Getting Started

Thanks for choosing SudoBot! In this article, you'll learn how to set up a custom instance of SudoBot and configure it to meet your requirements.

Note: If you don't want to set up the bot yourself and prefer a pre-hosted solution for free, you can contact @rakinar2 on Discord. Your Discord server should have at least 50 members to be eligible.

Requirements

Ensure that you meet the following requirements to host SudoBot:

You can also set up additional features with these tokens:

  • Cat and dog API Token (for fetching cat and dog images using cat and dog commands)
  • Pixabay API Token to use the pixabay command
  • Discord Webhook URL for sending error reports

Cloning the Project and Setting Up

Clone the repository using git or download the latest release and extract it. If you choose to clone, use the following command:

git clone https://github.com/onesoft-sudo/sudobot
cd sudobot/
Install dependencies:

```bash

npm install -D
Generate the JSON config schema files:

```bash
npx ts-node scripts/generate-config-schema.ts
Environment Variables
Create a file named .env in the root project directory and add the following variables:
dotenv

# Bot Token
TOKEN=
# Main Server ID
HOME_GUILD_ID=
# Client ID
CLIENT_ID=
# Database URL
DB_URL=

# Additional Environment Variables (if needed)
DEBUG=
SUDO_ENV=
NODE_ENV=
CAT_API_TOKEN=
DOG_API_TOKEN=
Setting Up a Database for the Bot
Set the DB_URL in .env to your PostgreSQL database URL. Then, run:

```bash

npx prisma db push
This command creates the necessary tables in the database.

Configuration
Edit the config/config.json and config/system.json files as needed. Follow the provided JSON schema and autocomplete features in your IDE/editor.

Registering Application Commands
Run the following command to register application slash commands and context menu commands:

```bash

node scripts/deploy-commands.js
Building the Bot
Compile the bot using:

```bash
npm run build
Starting the Bot
Start the bot:

```bash

npm start
If configured correctly, the bot will log in successfully to Discord. Congratulations, your SudoBot instance is ready!

#Emojis
Download custom emojis from [here](https://www.onesoftnet.eu.org/downloads/sudo/emojis/). If not added, the bot may send messages that look odd.

@github-actions github-actions bot added the type:docs Improvements or additions to documentation label Dec 30, 2023
@virtual-designer
Copy link
Member

virtual-designer commented Dec 30, 2023

Hi, thanks a lot once again for your contribution! However I think, the Getting Started page doesn't need much changes/deletion except the fix for #147.

Also I see that you've added 2 new files, those files are already merged into docs/ so it'd double up. To fix this, make your changes to a new branch next time. Hopefully you understand.

Would you like to make a fix for #147? It'd be a bit easy for me if you make a new PR in that case.

@virtual-designer
Copy link
Member

Since it's an important thing, I will change the docs page myself and avoid any further delays.

@GuynnR GuynnR deleted the patch-1 branch January 15, 2024 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants