# Moon-Moon IRC Bot

**Category:** Standalone_Bot
**Original Author:** Charles Heywood

## Description
Moon-Moon is a standalone IRC bot written in Lua using MoonScript for its scripting language. It supports various IRC commands and events, including joining channels, sending messages, handling user actions like kicks and modes, and managing database interactions.

## Key Features
- Manages multiple IRC connections with configurable servers and ports.
- Supports autojoining specified channels upon connection.
- Implements command hooks to handle custom bot commands.
- Utilizes coroutines for asynchronous operations.
- Integrates with a PostgreSQL database for storing and retrieving data.
- Handles various IRC events such as JOIN, PART, KICK, and PRIVMSG.

## File Analysis
- **compile.sh** — Compiles MoonScript files into Lua bytecode using `moonc` and `luac`.
- **start.sh** — Starts the bot by printing a logo and executing the main script.
- **LICENSE** — MIT License for the software.
- **README.md** — Documentation on dependencies, installation, and configuration.
- **.editorconfig** — Configuration for code style settings in editors.
- **.gitignore** — Specifies files to be ignored by Git.
- **.vimrc** — Vim configuration file with custom autocmds for compiling MoonScript files.
- **ISSUE_TEMPLATE.md** — Template for reporting issues.
- **config.ld** — LDoc configuration file for generating documentation.
- **logger.moon** — Logging utility module with colored output support.
- **logo** — ASCII art logo displayed at startup.
- **main.moon** — Main bot script that loads modules and configures IRC client behavior.
- **irc.md** — API documentation for the IRC connection class.
- **irc.moon** — Class definition for managing IRC connections, including hooks and handlers.
- **models.moon** — Imports and exports Channel and User classes.
- **std.moon** — Standard library with Result and Option types for error handling.
- **channel.moon** — Defines the Channel class.
- **user.moon** — Defines the User class.
- **base.moon** — Handles IRC client initialization, connection hooks, and batch processing.
- **batch.moon** — Implements batch processing for IRC events.
- **cap.moon** — Manages IRC capabilities negotiation.
- **command.moon** — Processes incoming commands from users.
- **data.moon** — Manages bot state data such as channels, users, and server information.
- **db.moon** — Initializes database connection for the bot.
- **output.moon** — Formats output messages with IRC color codes.
- **sasl.moon** — Implements SASL authentication methods.