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

discord-server-logger

v1.0.1

Published

A Discord.JS addon to log every message from a server.

Downloads

2

Readme

Discord.JS Server Logger

The discord-server-logger package is a small and simple addon to bots using Discord.JS, used to log any sent messages from a given server. This was originally made 3 or so years ago, and it's since been updated and changed from D.JS v11 to v13. If you need help or have questions, join my Discord server (https://discord.gg/4c8Rh7tWhv).

Explanation & Preview

The addon will watch a given server for any messages sent and log them in the logging server, including any attachments sent. Using webhooks in the logging server messages will have the users tag (e.g, Darko Pendragon#3124) as their username and the users avatar. Right below is a screenshot of the channel #gta-chat in a GTA server:
GTACHAT

Here is a screenshot of what this will now look like in the logging server:
GTACHATLOG

Setup

Requirements

Setup Steps

  1. Run npm install discord-server-logger --save in your working directory
  2. Get the ID of the server you want to log
  3. Create a new Discord server for the bot to log to
  4. Make sure the bot is in BOTH servers
  5. Require the module, and start your bot (example below)

Setup Example

const Discord = require('discord.js');
const DSL = require('discord-server-logger');

const client = new Discord.Client({ // these are the min required intents to run correctly
    intents: [
        Discord.Intents.FLAGS.GUILDS,
        Discord.Intents.FLAGS.GUILD_INTEGRATIONS,
        Discord.Intents.FLAGS.GUILD_WEBHOOKS,
        Discord.Intents.FLAGS.GUILD_MESSAGES
    ]
});

const Logger = new DSL(client, { // the only required options
    watchID: "SERVER TO WATCH ID (FROM STEP 2)",
    loggingID: "LOGGING SERVER ID (FROM STEP 3)"
});

client.login('BOT TOKEN');

Other Features

You can send messages as the bot from the logging server (W.I.P), quick example:

const Logger = new DSL(client, {
    sendAsBot: ["YOUR ID"],
    loggingID: "LOGGING SERVER ID",
    watchID: "SERVER TO WATCH ID"
});

Adding the sendAsBot option and including your ID in the array will then make your bot send messages you send in the logging server. For example, if you send "Error: no signs of intelligent life" in the logging server to the channel #general, your bot will then send the same message in the channel named #general within the server it's watching. Adding someone elses ID into the array will also allow them to do this. So far, this is the only extra feature.

Notes

  • The bot MUST be in the server you want to log.
  • The bot will NOT be able to log messages in channels it cannot see.
  • For easier setup in the logging server, give the bot the Administrator permission.
  • While this is updated for newer Discord.JS and Node.js versions, the code is still "sloppy."

Troubleshooting & Problems

If you run into any issues, or just have any questions/suggestions, you can join my Discord server (https://discord.gg/4c8Rh7tWhv) or add me on Discord, Darko Pendragon#3219.