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

trixxy-tempvoice

v1.0.0

Published

A package for managing temporary Discord voice channels.

Readme

trixxy-tempvoice

A Discord.js package for managing temporary voice channels.

Installation

npm install trixxy-tempvoice

Dependencies

This package relies on discord.js.

Setup in Discord

Before using this package, you need to set up your Discord server:

  1. Create a Category Channel: Create a new category channel named Temporary Voice Channels (or any name you prefer, but remember to update the code if you change it).
  2. Create a "Join to Create" Voice Channel: Inside the Temporary Voice Channels category, create a voice channel (e.g., ➕ Create Channel). This will be the channel users join to automatically create their temporary voice channel.

Usage

Here's how to use the TrixxyTempVoice class in your Discord bot:

const { Client, GatewayIntentBits } = require('discord.js');
const TrixxyTempVoice = require('trixxy-tempvoice');

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildVoiceStates, // Required for voice state updates
  ],
});

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);

  const tempVoiceManager = new TrixxyTempVoice(client);

  // Replace 'YOUR_GUILD_ID' with your server's ID
  // Replace 'YOUR_JOIN_TO_CREATE_CHANNEL_ID' with the ID of your "Join to Create" voice channel
  tempVoiceManager.setJoinToCreateChannel('YOUR_GUILD_ID', 'YOUR_JOIN_TO_CREATE_CHANNEL_ID');
});

client.login('YOUR_BOT_TOKEN');

TrixxyTempVoice Class Methods

constructor(client)

Initializes the temporary voice channel manager.

  • client: An instance of discord.js.Client.

setJoinToCreateChannel(guildId, channelId)

Configures a specific voice channel to act as a "join-to-create" channel within a guild. When a user joins this channelId, a new temporary voice channel will be created for them.

  • guildId: The ID of the Discord guild (server).
  • channelId: The ID of the voice channel that users will join to trigger the creation of a temporary channel.

handleVoiceStateUpdate(oldState, newState) (Private Method)

This method is an internal event listener for voiceStateUpdate. It detects when users join or leave voice channels and triggers the creation or deletion of temporary channels accordingly.

createTemporaryChannel(member) (Private Method)

Creates a new temporary voice channel for the given GuildMember. The channel is placed under the Temporary Voice Channels category and the creating member is given permissions to manage it. The user is then moved to this new channel.

  • member: The GuildMember object for whom the channel is to be created.

deleteTemporaryChannel(channel) (Private Method)

Deletes a specified temporary voice channel. This method is typically called when the channel becomes empty.

  • channel: The VoiceChannel object to be deleted.

isTemporaryChannel(guildId, channelId) (Private Method)

Checks if a given channel ID within a guild is a temporary channel managed by this instance.

  • guildId: The ID of the guild.
  • channelId: The ID of the channel to check.

Important Notes

  • Ensure your bot has the necessary permissions (Manage Channels, Move Members, View Channel, Connect) in the category where temporary channels will be created.
  • The category name Temporary Voice Channels is hardcoded in the createTemporaryChannel method. If you use a different category name, you must update the code accordingly.
  • This package relies on voiceStateUpdate events, so ensure your discord.js client has GatewayIntentBits.GuildVoiceStates enabled.