How hangddev/yubot works
Project type and purpose
• This is a Node.js–based Discord bot.
• Key files: bot.js / index.js (entry points), commands/, events/, handlers/, schema/.
• It provides AI‐powered chat and image generation, moderation, configuration, and utility commands.
File structure
• Top‐level:
• bot.js, index.js: create and start the Discord client.
• package.json: lists dependencies (discord.js, mongoose or similar, axios/OpenAI SDK).
• config/: static JSON (emoji mappings, possibly DB URIs).
• commands/: grouped by feature area (AI, config, context menus, moderation, utility). Each command exports a handler.
• events/: defines reaction to Discord gateway events:
• client ready
• message create, mentions
• interactionCreate (slash commands, button clicks, context menus)
• handlers/:
• loaders/command.js & event.js – dynamic registration of commands & events with the client.
• components/embed.js – helper for rich embeds.
• functions/functions.js – shared utilities.
• schema/: Mongoose or similar models for persistent settings (per‐guild config, chatbot history).
• structure/client.js: wrapper around discord.js Client with extended methods (e.g., logger, config loader).
Key architectural insights from the (minimal) README
• “Archived project” suggests no further docs, so infer architecture from code organization.