Skip to content

code0-tech/lacerta

Repository files navigation

Lacerta our Code0 Discord Bot

Basic Overview:

Code0 is a Discord bot developed in JavaScript, utilizing the discord.js client library along with a lightweight web server for GitHub OAuth authentication. This enables certain commands, such as retrieving commit and pull request data.

Requirements:

  • HTTP Port: Required for GitHub OAuth, configured via http-config.port in ./http-config.json.

  • MongoDB: Used for storing user and bot-related data, including:

    • XP statistics
    • Message count statistics
    • Command usage data

Main Interactions

Command Status Known Bugs
1 /open-contributer Finished None
2 /ticket Finished None
3 /links Finished None
4 /contributor Finished None
5 /rank or /rank @user +uptodate15 Finished None
6 /leaderboard or /leaderboard limit: 1-20 Finished None
7 Code0 Application Ticket Finished None
8 /stats or /stats @user + uptodate15 Finished None
9 /logs show or /logs list Finished None
10 /debug for debugging Finished None
11 Git rank message every 24 hours Finished None
12 /git display charts of Git activity In Progress None

Language

We currently provide 3 languages

  • german.json
  • english.json
  • lolcat.json (custom version)

Made by using the inbuild web editor...

Run it via node .\language-editor.js then go to http://localhost:3000

Note: If german key translation does not exist for a command, the fallback is always english

Tracking

The bot collects and processes certain statistics, as visible in the source code:

  • Message Statistics: Number of messages, words, and characters sent.
  • Voice Statistics: Join/leave events, channel switches, and total voice time.

GitHub OAuth

For /open-contributer, OAuth URLs are not stored. This means authentication is required each time the command is executed.

Command Tracking

Real Example:

{
  "id": "380808844093292555",
  "rawxp": 1444,
  "stats": {
    "messages": {
      "words": 4555,
      "chars": 24207,
      "count": 737
    },
    "voice": {
      "joins": 130,
      "switchs": 21,
      "time": 164817
    }
  },
  "commandstats": {
    "debug": {
      "command": 80,
      "button": 22,
      "selectmenu": 15
    },
    "leaderboard": {
      "command": 21
    },
    "stats": {
      "command": 65
    },
    "logs": {
      "command": 29,
      "button": 82
    },
    "logs list": {
      "selectmenu": 20
    },
    "links": {
      "command": 2
    },
    "open-contributor": {
      "command": 11
    },
    "mydata": {
      "command": 12
    },
    "git": {
      "autocomplete": 248,
      "command": 124
    },
    "logs show": {
      "button": 7
    },
    "ticket": {
      "command": 5,
      "button": 7
    },
    "_application": {
      "button": 2
    },
    "rank": {
      "command": 80
    }
  }
}

Last MongoDB structure update: 12.12.2025

Tip: You can mention a Discord user by their ID using <@user_id>.

Missing Files

This repository mirrors the live bot but excludes sensitive or unnecessary files:

  • node_modules/ – Not included (use npm install to generate).
  • server.env / .env – Contains private configuration and tokens.
  • unused-temp.js – Unused code snippets, kept for reference.
  • a-workon/ – Work-in-progress features.
  • .gitignore – Specifies ignored files.

💡 If you need a setup template, feel free to contact me on Discord: [DC: nixkuchen].

Documentation

Currently, no official documentation is available. However, you can explore the bot’s functionality yourself or contact [DC: nixkuchen] for guidance.

Unused Discord Bot Files

Files located in ./_app/* are for Discord server setup (e.g., images).

Versions

The bot is fully functional with the following package versions:

"@discordjs/voice": "^0.18.0"     // [12.12.2025]
"chartjs-node-canvas": "^5.0.0"   // [12.12.2025]
"discord-simpletable": "^1.1.6"   // [12.12.2025]
"discord.js": "^14.25.1"          // [12.12.2025]
"dotenv": "^17.2.3"               // [12.12.2025]
"libsodium-wrappers": "^0.7.15"   // [12.12.2025]
"mongo": "^0.1.0"                 // [12.12.2025]
"node-fetch": "^2.6.12"           // [12.12.2025]
"node-schedule": "^2.1.1"         // [12.12.2025]
"puppeteer": "^23.11.1"           // [12.12.2025]

Tips:

  • Run npm outdated to check which packages can be updated
  • Run npm update <package-name> to update a single package

or use the build in script

  • npm run outdated

Commit Naming Conventions

  • wip – Work in progress.
  • todo – Task that needs to be completed.
  • readme – README updates.
  • naming – Renaming constants, variables, or text.
  • v/version – Version updates in package.json.

What does ... mean?

  • uptodate15: This means the message will be updated when changes occur up to 15 more minutes after the interaction execution.

Code Quality & Development Philosophy

Software is always evolving, and Code0 is no exception. Here’s why code may sometimes appear incomplete or unpolished:

  1. Rapid Development: The goal is to ensure functionality first.
  2. Changing Requirements: Features are frequently adjusted to meet new needs.
  3. Ongoing Refinements: Code is continuously improved for efficiency and maintainability.
  4. Organized Messiness: While some sections may seem unstructured, they function correctly. Any outstanding issues are documented in TODO (index.js).
  5. Fast-Paced Changes: In the early stages, speed often takes priority over perfection.

Since Code0 is actively in development, expect ongoing improvements and changes.

Nicusch Versioning System (NVS)

  • 0.0.1 – Minor bug fixes or small functional improvements.
  • 0.1.0 – Command modifications or updates that impact functionality.
  • 1.0.0 – Major changes affecting class structures and breaking compatibility.

💡 This system has been in use since 10.07.2024, but earlier commits may not follow it consistently.

Know issues

  • 📱 Mobile UI Bug: Tables, charts and Progress Bar's do not display correctly on mobile devices, but there are currently no plans to fix it soon, and it may remain unresolved indefinitely (Reported: 01.01.2025).

About

Our entertaining discord-bot.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •