No description
  • JavaScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Chris Cookman feaf0a3978
Some checks failed
ptero-push / build (push) Has been cancelled
Fetch users before actions
2026-09-11 23:36:45 -06:00
.forgejo/workflows Guh 2025-05-27 20:37:45 -06:00
.vscode Moved to a new repo; Fix small thin preventing startup/message handler fix 2025-05-07 23:46:28 -06:00
data Add some perm debugging commands 2026-09-11 23:30:38 -06:00
images Moved to a new repo; Fix small thin preventing startup/message handler fix 2025-05-07 23:46:28 -06:00
testing Moved to a new repo; Fix small thin preventing startup/message handler fix 2025-05-07 23:46:28 -06:00
.gitignore Moved to a new repo; Fix small thin preventing startup/message handler fix 2025-05-07 23:46:28 -06:00
config.json.template Lavalink go brr 2026-08-26 12:09:47 -06:00
debug.js Moved to a new repo; Fix small thin preventing startup/message handler fix 2025-05-07 23:46:28 -06:00
eval.md add eval.md 2026-09-09 00:57:03 -06:00
funcs.js Moved to a new repo; Fix small thin preventing startup/message handler fix 2025-05-07 23:46:28 -06:00
genblacklist.js Moved to a new repo; Fix small thin preventing startup/message handler fix 2025-05-07 23:46:28 -06:00
goodrooms.json Moved to a new repo; Fix small thin preventing startup/message handler fix 2025-05-07 23:46:28 -06:00
index.js Fetch users before actions 2026-09-11 23:36:45 -06:00
LICENSE Moved to a new repo; Fix small thin preventing startup/message handler fix 2025-05-07 23:46:28 -06:00
package.json Lavalink go brr 2026-08-26 12:09:47 -06:00
PERMISSIONS.md Add some perm debugging commands 2026-09-11 23:30:38 -06:00
PRIVACY.md Add support email; Fix message counter. 2026-09-11 23:14:43 -06:00
README.md Add some perm debugging commands 2026-09-11 23:30:38 -06:00
TERMS.md Add support email; Fix message counter. 2026-09-11 23:14:43 -06:00
testmsg.json fix/retry-sending-failed-msgs (#1) 2026-06-12 10:01:24 -06:00
TODO Add TODO; Remove alter table 2025-05-23 14:16:46 -06:00
wstest.js fix/retry-sending-failed-msgs (#1) 2026-06-12 10:01:24 -06:00

Join our Discord Add the bot

Warning

This is SUPER tossed together. Might bother cleaning it up later.

What is this?

This is meant to be a public Discord bot. It connects via XMPP to Weather.IM and allows server owners to subscribe a channel to any number of weather alerts.

For a full breakdown of Discord permissions required by the bot, see PERMISSIONS.md.

Pre-requisites

  1. Node.js
  2. NPM
  3. A Discord bot token
  4. A running Lavalink server (only required if voice_enabled is true - see Voice / Lavalink Setup below)

How do I use this?

  1. Clone the repo
  2. Install the requirements with npm install
  3. Copy config.json.template to config.json and fill in the values
    • token is your Discord bot token
    • clientId is your Discord application/bot's ID (needed for voice/Lavalink)
    • owner is your Discord user ID
    • mainGuild is the ID of the guild you want to use as the main guild (This is used for making the support invite)
    • inviteChannel is the ID of the channel you want to use for the support invite
    • NTFY config is optional, leave enabled false if you don't want to use it or don't know how.
    • lavalink config is only used if voice_enabled is true, see Voice / Lavalink Setup below.
  4. Run node .
  5. Profit?

The bot uses Lavalink to join voice channels and stream audio (NWR streams, Broadcastify streams, and generic /play URLs). Lavalink is a standalone server that handles all the actual audio streaming/encoding, so the bot itself no longer needs any native audio dependencies (opus, sodium, ffmpeg, etc.) - it just tells Lavalink what to play.

1. Requirements

  • Java 17 or newer (Java 21 recommended) - required to run the Lavalink server jar.
  1. Download the latest Lavalink.jar from the Lavalink releases page.

  2. In the same folder as the jar, create an application.yml file. A minimal config that supports HTTP/HTTPS radio streams (which is all this bot needs) looks like:

    server:
      port: 2333
      address: 0.0.0.0
    
    lavalink:
      server:
        password: "youshallnotpass"
        sources:
          http: true
          youtube: false
          soundcloud: false
          bandcamp: false
          twitch: false
          vimeo: false
          local: false
    
    logging:
      level:
        root: INFO
        lavalink: INFO
    
    • Change password to something secret, it's used to authenticate the bot's connection to this Lavalink server.
    • The http source is what allows Lavalink to play the raw stream URLs (NWR streams, Broadcastify, /play <url>) this bot uses. The other sources (YouTube, SoundCloud, etc.) aren't needed and can stay disabled.
  3. Start the server:

    java -jar Lavalink.jar
    

    You should see a log line indicating the server started (e.g. Lavalink is ready to accept connections.).

    You can also run Lavalink via Docker instead, see the official Lavalink getting-started guide for a docker-compose.yml example.

In config.json, fill in the lavalink block to match whatever you configured in application.yml:

"lavalink": {
	"id": "main",
	"host": "localhost",
	"port": 2333,
	"password": "youshallnotpass",
	"secure": false
}
  • host/port should point to wherever the Lavalink server is running (if it's running on the same machine as the bot, localhost is fine).
  • password must match the lavalink.server.password value in application.yml.
  • secure should be true if your Lavalink server is behind HTTPS/WSS (e.g. behind a reverse proxy with TLS).
  • Also make sure config.discord.clientId is set to your bot's application ID - it's required to establish the Lavalink session.

4. Enable voice commands

Set "voice_enabled": true in config.json and restart the bot. This registers the /play, /playbcfy, /nwrplay, /leave, /pause, and /volume slash commands, and connects to the configured Lavalink node on startup.

If the Lavalink node is unreachable, the bot will still run, but voice commands will fail until the node connects.

TODO

  • Clean up the code
  • Add more error handling
  • Add more logging
  • Add more features
  • Add more documentation