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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@openpets/discord

v1.0.1

Published

Search and read messages from Discord servers, list channels, send messages using a Discord bot, and connect personal Discord accounts via mautrix-discord Matrix bridge

Downloads

17

Readme

Discord Pet

Discord integration for reading messages, listing channels, and managing servers. Supports both Discord Bot API and mautrix-discord Matrix bridge for personal account access.

Features

Bot API Features

  • List servers (guilds) the bot has access to
  • List channels in a server
  • Read and search messages
  • Send messages (when enabled)
  • Generate bot invite URLs

Matrix Bridge Features (via mautrix-discord)

  • Connect personal Discord accounts without a bot
  • QR code and token-based login
  • Bridge Discord servers to Matrix
  • Access DMs and private servers

Quick Start

Option 1: Bot Token (Recommended for Servers)

  1. Create a Discord Application at https://discord.com/developers/applications
  2. Go to Bot section and create a bot
  3. Copy the bot token
export DISCORD_BOT_TOKEN="your-bot-token"
export DISCORD_APPLICATION_ID="your-app-id"
  1. Use discord-generate-invite-url to get an invite link and add the bot to your server

Option 2: Matrix Bridge (For Personal Accounts)

  1. Deploy mautrix-discord: https://github.com/mautrix/discord
  2. Configure the bridge and get the shared secret from your config
export DISCORD_BOT_TOKEN="dummy"  # Required but not used for bridge
export MAUTRIX_BRIDGE_URL="https://your-bridge.example.com"
export MAUTRIX_SHARED_SECRET="your-provisioning-secret"
  1. Use discord-bridge-login-token or discord-bridge-login-qr to connect

Environment Variables

Required

| Variable | Description | |----------|-------------| | DISCORD_BOT_TOKEN | Discord Bot Token from Developer Portal |

Optional

| Variable | Description | |----------|-------------| | DISCORD_APPLICATION_ID | Application ID for generating invite URLs | | DISCORD_PUBLIC_KEY | For webhook verification (interactions) | | DISCORD_ENABLE_POSTING | Set to true to enable sending messages | | MAUTRIX_BRIDGE_URL | URL of your mautrix-discord bridge instance | | MAUTRIX_SHARED_SECRET | Bridge provisioning API shared secret |

Available Tools

Bot API Tools

  • discord-bot-status - Check bot connection status
  • discord-verify-setup - Verify configuration and diagnose issues
  • discord-generate-invite-url - Generate OAuth2 bot invite URL
  • discord-join-server - Get instructions for adding bot to a server
  • discord-list-guilds - List accessible servers
  • discord-list-channels - List channels in a server
  • discord-get-channel-info - Get channel details
  • discord-get-channel-messages - Read messages from a channel
  • discord-fetch-all-messages - Fetch all messages with pagination
  • discord-search-messages - Search messages in a guild
  • discord-send-message - Send a message (requires DISCORD_ENABLE_POSTING)
  • discord-get-guild-info - Get server details

Bridge Tools (when MAUTRIX_BRIDGE_URL is configured)

  • discord-bridge-status - Check bridge connection status
  • discord-bridge-login-qr - Start QR code login flow
  • discord-bridge-login-token - Login with Discord token
  • discord-bridge-logout - Disconnect Discord account
  • discord-bridge-guilds - List guilds via bridge
  • discord-bridge-connect-guild - Bridge a guild to Matrix

Usage Examples

# List all servers
opencode run "list all discord servers I have access to"

# Read recent messages
opencode run "get the last 20 messages from channel 123456789"

# Search for content
opencode run "search for messages containing 'meeting' in the server"

# Check bridge status
opencode run "check my discord bridge connection status"

# Login via bridge
opencode run "login to discord using token"

Getting IDs

  1. Enable Developer Mode in Discord (User Settings > Advanced > Developer Mode)
  2. Right-click any server, channel, or user to copy their ID

Getting a User Token (for Bridge)

  1. Log into Discord in a browser (private window recommended)
  2. Open Developer Tools (F12 or Cmd+Shift+I)
  3. Go to Network tab, filter by api
  4. Reload the page
  5. Click any successful request
  6. Find Authorization header in Request Headers
  7. Copy the token value

Note: User tokens should be kept private and not shared.

mautrix-discord Setup

For detailed bridge setup instructions, see:

  • https://docs.mau.fi/bridges/go/discord/index.html
  • https://github.com/mautrix/discord

Basic Docker setup:

services:
  mautrix-discord:
    image: dock.mau.dev/mautrix/discord:latest
    volumes:
      - ./config:/data
    ports:
      - "29334:29334"