npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

easyauditlogger

v1.0.3

Published

Easy Discord audit logger system, making audit logs simpler

Downloads

154

Readme

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

easyAuditLogger is designed to be simple and intuitive. Below is an example of how to use it to log when a role is created:

const Logger = require('easyauditlogger');

//roleCreate
client.on('roleCreate', async (role) => {

  //Ensure it only grabs This Event
  const logger = new Logger();

  // Retrieve the guild ID where the role was created
  const guildID = role.guild.id;

  // Generate an embed with the role creation details
  const logEmbed = await logger.logRoleCreate(role);

  // Send the embed to the desired logging channel
  await client.guilds.cache.get(guildID).channels.cache.get('012345678901234567').send({ embeds: [logEmbed] });//Replace with your channel ID, or database entry for the ID
});

Supported Events

easyAuditLogger supports logging for the following Discord events:

Channel Events

  • channelCreate
  • channelUpdate
  • channelDelete
  • category (not an event but type on the event)
  • media (not an event but type on the event)
  • forum (not an event but type on the event)

Emoji Events

  • emojiCreate
  • emojiUpdate
  • emojiDelete

Role Events

  • roleCreate
  • roleUpdate
  • roleDelete

Message Events

  • messageCreate (Currently logs poll creation)
  • messageUpdate
  • messageDelete (Works with the example code on the github)
  • messageDeleteBulk

Member Events

  • guildMemberUpdate

Ban Events

  • guildBanAdd (Includes ban reason)
  • guildBanRemove

Voice Events

  • voiceStateUpdate (First time join is still experimental)

Sticker Events

  • stickerCreate
  • stickerUpdate
  • stickerDelete

Thread Events

  • threadCreate
  • threadUpdate
  • threadDelete

Scheduled Events

  • guildScheduledEventCreate
  • guildScheduledEventUpdate
  • guildScheduledEventUserAdd
  • guildScheduledEventUserRemove
  • guildScheduledEventDelete

Customization

You can easily customize the appearance of the logs by modifying the embed colors, adding additional fields, or changing the default settings. For example:

  logger.newColour('#DF927D')//has to be hexdecimal code (https://www.color-hex.com/) for a specific colour of choice
  //Pre-defined colours
  logger.newColour('red')
  logger.newColour('yellow')
  logger.newColour('orange')
  logger.newColour('green')
  logger.newColour('smokeygrape')

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 wont 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