For the complete documentation index, see llms.txt. This page is also available as Markdown.

Getting Started

This page explains how to create your own plugin for AthenaBot using the Plugin Template. The internal Developer API makes it easy to extend AthenaBot’s functionality without touching the core code.


1. Setting up your editor

If you are using Visual Studio Code, you can enable typings for AthenaBot by creating a configuration file in the root directory. This will help you see available functions directly in your editor.

{
  "compilerOptions": {
    "module": "ESNext",
    "moduleResolution": "Node",
    "target": "ES2020",
    "jsx": "react",
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "baseUrl": "./",
    "paths": {
      "*": ["types/*"]
    }
  },
  "exclude": [
    "node_modules",
    "**/node_modules/*"
  ]
}

We also use ESLint to keep the codebase clean and consistent. If you want to follow the same style rules, create a file called .eslintrc.json in the root directory and paste the following:


2. Downloading the plugin template

  1. Download the template files with Code → Download ZIP or clone it with Git.

  2. Place the entire folder into your AthenaBot installation under /plugins/.

Your directory structure should look like this:


3. Understanding the plugin template

Main file

Below is the entry point of your plugin. This example was taken from the template itself. We will go through the whole main.js file step by step.

The heart object is your access point to the Developer API, including logging, configs, and utilities.

Class constructor

  • Name: Your plugin name. Make sure this is unique.

  • Author: Your username.

  • Version: Your plugin version.

  • RequiredAthenaVersion: Specifies the minimum AthenaBot version needed for the plugin.

  • Priority: The higher the number, the earlier your plugin will be loaded.

  • Dependencies: List of plugin dependencies required for this plugin to run. All plugins depend on the core plugin.

  • softDependencies: Optional plugin dependencies.

  • nodeDependencies: Node.js dependencies that are installed before loading.

  • channels: Registered channels that can be configured through Athena’s /setup command.

  • dashboard.cannotDisable: If set to true, the plugin cannot be disabled in the dashboard.

Config constructor

If your plugin does not offer a config, you can remove the following code snippet from your plugin template.

  • Line 1: Always keep the heart object for the config manager.

  • Line 2: name is the config name. In this example, your config is called hello.

  • Line 3-17: This defines the structure of your plugin configuration file.

Important: Your configuration file must start with a top-level config object.

Last updated