npm.io
1.1.0 • Published 2d agoCLI

easyauditlogger

Licence
BSD-3-Clause
Version
1.1.0
Deps
0
Size
161 kB
Vulns
0
Weekly
0

npm monthly downloads

easyAuditLogger - Simplify Discord Audit Logging

easyAuditLogger is a lightweight and easy-to-use module designed to simplify the process of capturing and logging audit events in your Discord bot. Whether you're tracking role changes, message deletions, or user updates, easyAuditLogger handles it smoothly.

Installation

You can install easyAuditLogger using npm:

npm install easyauditlogger

How to Use

Here is a snippet on how to use the roleCreate, Below this is the example viewer on how to use the rest of the package.

client.on('roleCreate', async (role) => {
    // Remove the following if you are using global
    const guildID = role.guild.id;

    // Generate a container with the role creation details
    const logContainer = await logger.logRoleCreate(role);

    // Send the container to the desired logging channel 
    // (paste this in the channels.cache.get if you are using global channel selector for multi-guild) guildChannelID
    await client.guilds.cache.get(guildID).channels.cache.get('ChannelID').send({
        components: [logContainer],
        flags: MessageFlags.IsComponentsV2,
        allowedMentions: { parse: [] },
    });
});

You can easily customize the appearance of the logs by modifying the container colours or using predefined ones:

logger.newColour('0xff5733'); //hexdecimal code (https://www.color-hex.com/)
logger.newColour('red');
logger.newColour('yellow');
logger.newColour('orange');
logger.newColour('green');
logger.newColour('smokeygrape');

Example Viewer (CLI)

easyAuditLogger includes a built‑in CLI tool that opens a syntax‑highlighted HTML preview of the example index file.
This gives you a clean, readable, browser‑based demonstration of how to implement the logger — no digging through folders required.

Features
  • Opens in your default browser
  • Uses Highlight.js for syntax highlighting
  • Styled with a VS Code‑like dark theme
  • Scrollable, formatted code block
  • Works via `npx` or global install
  • Cross‑platform (Windows, macOS, Linux)
Usage
npx easyauditlogger open

This will open a browser window titled easyAuditLogger Example Viewer, displaying the full example index file with proper syntax highlighting.

for a list of other commands you can just leave it blank npx easyauditlogger

Supported Events

easyAuditLogger supports logging for the following Discord events:

Channel Events

  • channelCreate
  • channelUpdate
  • channelDelete
  • [Below are types of channel events]
  • category
  • media
  • forum

Emoji Events

  • emojiCreate
  • emojiUpdate
  • emojiDelete

Role Events

  • roleCreate
  • roleUpdate
  • roleDelete

Message Events

  • messageCreate
  • messageUpdate
  • messageDelete
  • messageDeleteBulk

Member Events

  • guildMemberUpdate

Ban Events

  • guildBanAdd
  • guildBanRemove

Voice Events

  • voiceStateUpdate

Sticker Events

  • stickerCreate
  • stickerUpdate
  • stickerDelete

Thread Events

  • threadCreate
  • threadUpdate
  • threadDelete

Scheduled Events

  • guildScheduledEventCreate
  • guildScheduledEventUpdate
  • guildScheduledEventUserAdd
  • guildScheduledEventUserRemove
  • guildScheduledEventDelete

Invites

  • inviteCreate
  • inviteDelete

Support

If you encounter any issues or have questions, feel free to join our Discord server for support.

Please note that updates may not always be immediate, as this project is maintained alongside other commitments.

License

This project is licensed under the BSD-3-Clause License. See the LICENSE file for more details.

Request

I Rarrorr (Tomtomvader298), would like to request that anyone who uses my package won't redistribute if anyone (*you) alters the file source.
Since I am a solo developer it takes time for me to add additional things, or fix minor hiccups!

Enjoy