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

Create system-config-schema.md #146

Merged
merged 4 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions docs/GuildConfigSchema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# SudoBot Configuration

SudoBot's behavior is controlled through a comprehensive JSON schema. This README provides an overview of the Guild Configuration Schema, allowing you to tailor the bot's behavior to suit your server's needs. Refer to [GuildConfigSchema.ts](https://github.com/onesoft-sudo/sudobot/blob/main/src/types/GuildConfigSchema.ts) and [SystemConfigSchema.ts](https://github.com/onesoft-sudo/sudobot/blob/main/src/types/SystemConfigSchema.ts) for the complete schema.

## Guild Configuration Schema

The Guild Configuration Schema encompasses various settings for SudoBot. Below are detailed explanations for key sections of the schema:

### Prefix and Debug Mode

- **`prefix`**: Defines the command prefix for SudoBot. By default, commands are triggered with a prefix of `-`. You can customize this to align with your server's preferences.

- **`debug_mode`**: When set to `true`, enables debug mode, providing additional information useful for developers. Typically, debug mode is disabled in production environments.

### Commands Configuration

- **`commands`**: Configuration related to bot commands.

- **`mention_prefix`**: If set to `true`, allows commands to be triggered with mentions (e.g., `@SudoBot help`). If set to `false`, only the command prefix triggers commands.

- **`bean_safe`**, **`shot_safe`**, **`fakeban_safe`**: Arrays of User IDs who are immune from bean, shot or fakeban commands.

- **`echo_mentions`**: If set to "True" option tells the bot whether to also ping roles when someone uses the echo comamnd.

- **`moderation_command_behaviour`**: Specifies the behavior for moderation commands, either "delete" (delete the command message) or "default" (keep the command message).

- **`rerun_on_edit`**: When set to `true`, the bot will rerun commands when they are edited.

- **`default_joke_type`**: Sets the default type for joke commands. Options are "random", "joke", or "dadjoke".

### Permissions Configuration

- **`permissions`**: Configuration for managing permissions.

- **`mod_role`**, **`admin_role`**, **`staff_role`**: (DEPRECATED) Use available permission systems instead.

- **`invincible_roles`**: Array of Snowflake IDs for roles with invincible permissions. Members with these roles have immunity from certain actions.

- **`mode`**: Permission mode. Options are "discord" (Discord roles only), "levels" (0-100), or "layered" (permission overwrite based system).

- **`check_discord_permissions`**: This option checks for role positions when taking actions by using commands, or when AutoMod decides to take an action. If this is "false", none of those safe permission checking will be done.
66 changes: 66 additions & 0 deletions system-config-schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# SudoBot System Configuration

SudoBot's behavior can be customized using a comprehensive system configuration schema. This document provides an overview of key configuration options and how to tailor the bot to your needs.

## Table of Contents

- [Overview](#overview)
- [Configuration Schema](#configuration-schema)
- [Emojis](#emojis)
- [System Admins](#system-admins)
- [Snippets](#snippets)
- [Presence](#presence)
- [Commands](#commands)
- [Logging](#logging)
- [API Status](#api-status)
- [Extensions](#extensions)
- [Log Server](#log-server)
- [Debug Mode](#debug-mode)

## Overview

The system configuration for SudoBot is defined using TypeScript and the `zod` library. The configuration schema provides a structured way to set various options, allowing you to customize the bot's behavior according to your preferences.

## Configuration Schema

The [SystemConfigSchema](https://github.com/onesoft-sudo/sudobot/blob/main/src/types/SystemConfigSchema.ts) defines the entire system configuration. Refer to this file for detailed information on each configuration option.

## Emojis

Customize emojis used by the bot. The `emojis` configuration allows you to set specific emoji strings for different purposes within the bot.

## System Admins

Specify users with system admin privileges using the `system_admins` configuration. Users in this list have elevated access to manage and configure the bot.

## Snippets

Configure snippet-related settings using the `snippets` configuration. This includes options like saving attachments with snippets.

## Presence

Set the bot's name, status, and activity type using the `presence` configuration. Define the bot's online status, custom status message, and activity type.

## Commands

Customize command-related options using the `commands` configuration. For example, enable or disable the mention prefix for commands.

## Logging

Enable logging and specify channels for logs with the `logging` configuration. This section includes options to control various aspects of logging within the bot.

## API Status

The `api` configuration provides information about the bot's API status. Check the operational status of the server and view related details such as server status and description.

## Extensions

The `extensions` configuration allows you to control the default mode for extensions. Specify whether to enable or disable all extensions by default.

## Log Server

Configure the log server using the `log_server` configuration. Options include enabling and auto-starting the log server.

## Debug Mode

Enable or disable debug mode with the `debug_mode` configuration. Debug mode provides additional logging and information helpful for troubleshooting.