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

@shadowrunners/automata

v2.4.3

Published

Automata is a fork of the Poru (by parasop) lavalink client developed and maintained by scrappie.

Downloads

19

Readme

What's this and how is it different from Poru?

Automata is a fork of the Poru lavalink client developed and maintained by parasop. This fork contains tweaks to certain functions and modified functionality such as the de-coupling from YouTube entirely with this fork only being able to play audio from platforms such as Deezer, SoundCloud, Spotify etc and some performance related optimizations.

The old v1 branch is based on Poru 3.7.2. This branch is based on Poru v4 with full support for Lavalink's new REST API.

Installation

npm install @shadowrunners/automata

Example

Below is a snippet of how to use the library. If you want a full bot example, check out Evelyn's music folder.

const { Client, GatewayIntentBits } = require("discord.js");
const { Manager } = require("@shadowrunners/automata");

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.GuildVoiceStates,
  ],
});

client.manager = new Manager(
  client,
  {
    name: "main_node",
    host: "localhost",
    port: 8080,
    password: "iloveyou3000",
  },
  {
    reconnectTime: 2000,
    resumeStatus: true,
    resumeTimeout: 60,
    defaultPlatform: "dzsearch",
  }
);

client.manager.on("trackStart", (player, track) => {
  const channel = client.channels.cache.get(player.textChannel);
  return channel.send(`Now playing \`${track.title}\``);
});

client.on("ready", () => {
  console.log("Ready!");
  client.manager.init(client);
});

client.on("interactionCreate", async (interaction) => {
  if (!interaction.isChatInputCommand()) return;

  const { options, member, guild, channelId } = interaction;

  await interaction.deferReply();

  if (!member.voice.channel) return interaction.editReply({ embeds: [embed.setDescription('🔹 | You need to be in a voice channel to use this command.')] });

  const query = options.getString("query");
  const res = await client.manager.resolve({ query, requester: member });

  const player = client.manager.create({
    guildId: guild.id,
    voiceChannel: member.voice.channelId,
    textChannel: channelId,
    deaf: true,
  });

  switch (res.loadType) {
    case 'error': return interaction.editReply({ content: "Failed to load track." });
    case 'empty': return interaction.editReply({ content: "No results found." });
    case 'playlist': {
      for (const track of res.tracks) player.queue.add(track);

      interaction.editReply({ content: `${res.playlist.name} has been loaded with ${res.playlsit.tracks.length}` });
    case 'search':
    case 'track':
      player.queue.add(res.tracks[0]);
      if (!player.isPlaying && player.isConnected) player.play();
      interacton.editReply(`Enqueued track: \n \`${track.title}\``);
    default:
      break;
  }
});

client.login('wee woo discord token goes here');

Documentation

You can check out the documentation for this fork here.

Credits

Full credit goes to parasop for creating Poru.