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

@leinstay/discobot

v1.0.2

Published

A simple commandless discord bot for 24/7 streaming of internet radio stations (e.g. SHOUTcast).

Downloads

29

Readme

Discobot

A simple commandless discord bot for 24/7 streaming of internet radio stations (e.g. SHOUTcast).

Discobot

Requirements

  • [Node] (https://nodejs.org/en/)
  • [NPM] (https://www.npmjs.com/)
  • [FFMPEG] (https://www.ffmpeg.org/)

Getting started

First make sure you have all the required tools installed on your machine then continue with these steps.

Installation using Docker


# Clone the repository
git clone https://github.com/leinstay/discobot.git

# Build the image
make build

# Start the image
make start

Installation using npm

# Clone the repository
git clone https://github.com/leinstay/discobot.git

# Enter into the directory
cd dmbot/

# Install the dependencies
npm install

Configuration

After cloning the project and installing all dependencies provide proper Discord API token, default voice channel ID, default text channel ID (for now playing notifications), and url for one or more music stream in config.json file. To acquire channel ID, enable developer mode in Discord and right-click any channel.

Example configuration for radio station:

{
  "prefix": "!a",
  "token": "{BOT TOKEN}",
  "voicechannel": "{VOICE CHANNEL ID}",
  "logchannel": "{TEXT CHANNEL ID}",
  "activity": "Anime Radio",
  "list": [
    {
      "name": "Anime Radio",
      "url": "https://pool.anison.fm/AniSonFM(320)?nocache=0.05"
    }
  ]
}

Example configuration for custom playlist:

{
  "prefix": "!d",
  "token": "{BOT TOKEN}",
  "voicechannel": "{VOICE CHANNEL ID}",
  "logchannel": "{TEXT CHANNEL ID}",
  "activity": "Ranobe Radio",
  "list": [
    {
      "name": "Shinkai Makoto - Five centimeters per second.",
      "url": "https://m17.akniga.club/b/54644/bIoDhyKuJ5rGPM_IFqIC3A,,/01.%20%D0%A1%D0%B8%D0%BD%D0%BA%D0%B0%D0%B9%20%D0%9C%D0%B0%D0%BA%D0%BE%D1%82%D0%BE%20-%20%D0%9F%D1%8F%D1%82%D1%8C%20%D1%81%D0%B0%D0%BD%D1%82%D0%B8%D0%BC%D0%B5%D1%82%D1%80%D0%BE%D0%B2%20%D0%B2%20%D1%81%D0%B5%D0%BA%D1%83%D0%BD%D0%B4%D1%83.mp3"
    },
    {
      "name": "Aya Hazuki - And again, I say hello.",
      "url": "https://m17.akniga.club/b/55024/bIoDhyKuJ5rGPM_IFqIC3A,,/01.%20%D0%90%D1%8F%20%D0%A5%D0%B0%D0%B7%D1%83%D0%BA%D0%B8%20-%20%D0%98%20%D1%81%D0%BD%D0%BE%D0%B2%D0%B0%20%D0%B3%D0%BE%D0%B2%D0%BE%D1%80%D1%8E%20%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82.mp3"
    },
    {
      "name": "Natsume Akatsky - The Goddess blesses this beautiful world.",
      "url": "https://m17.akniga.club/b/54240/bIoDhyKuJ5rGPM_IFqIC3A,,/01.%20%D0%9D%D0%B0%D1%86%D1%83%D0%BC%D1%8D%20%D0%90%D0%BA%D0%B0%D1%86%D0%BA%D0%B8%20-%20%D0%90%D1%85,%20%D0%BC%D0%BE%D1%8F%20%D0%B1%D0%B5%D1%81%D0%BF%D0%BE%D0%BB%D0%B5%D0%B7%D0%BD%D0%B0%D1%8F%20%D0%B1%D0%BE%D0%B3%D0%B8%D0%BD%D1%8F.mp3"
    },
    {
      "name": "Nagatsuki Tappei - Re:Zero. Living in an alternative world from scratch.",
      "url": "https://m17.akniga.club/b/55324/Od3Ak6Dt6YnLfHZMTZNTsg,,/01.%20%D0%9D%D0%B0%D0%B3%D0%B0%D1%86%D1%83%D0%BA%D0%B8%20%D0%A2%D0%B0%D0%BF%D0%BF%D1%8D%D0%B9%20-%20%D0%96%D0%B8%D0%B7%D0%BD%D1%8C%20%D0%B2%20%D0%B0%D0%BB%D1%8C%D1%82%D0%B5%D1%80%D0%BD%D0%B0%D1%82%D0%B8%D0%B2%D0%BD%D0%BE%D0%BC%20%D0%BC%D0%B8%D1%80%D0%B5%20%D1%81%20%D0%BD%D1%83%D0%BB%D1%8F.mp3"
    },
    {
      "name": "Jumpei Inuzuka - Café from another world",
      "url": "https://m17.akniga.club/b/55175/Od3Ak6Dt6YnLfHZMTZNTsg,,/01.%20Inuzuka%20Junpei%20-%20%D0%9A%D0%B0%D1%84%D0%B5%20%D0%B8%D0%B7%20%D0%B4%D1%80%D1%83%D0%B3%D0%BE%D0%B3%D0%BE%20%D0%BC%D0%B8%D1%80%D0%B0.mp3"
    }
  ]
}

Starting the application

Since the bot works even when there is no one in the channel, I strongly recommend to use forever or pm2 with cron autorestart for non-stop broadcasting (because of Discord API features the bot has a tendency to transmit silence after 20-30 hours of uptime).

pm2 start index.js --name DiscoBot --log bot.log --time --restart-delay 5000 & pm2 start restart.js --name Restart

Оr you can do it without process managers.

node index.js