Skip to content

zedseven/radium

Repository files navigation

Radium (Radio) Bot

Logo

License: GPLv3

A music & dice bot made for personal use.

I made this for use by my friends and I on Discord. You're welcome to use it if you want to, but it isn't intended for widespread use.

Infrastructure

SponsorBlock Integration

While playing videos from YouTube, the bot will automatically skip sponsored segments, intros and outros, non-music sections in music videos, and more.

This uses the fantastic SponsorBlock service, which is run on curated user-submitted timestamps.

Dice Rolling

Parses the roll expression into Reverse Polish Notation, then processes dice rolls into numbers (by rolling) and calculates the result. Because of this, it supports arbitrary mathematical expressions - even with no dice involved.

For example, you can do crazy stuff like this:

-roll (3d20b2 + 11) ^ (d4 * 2) / 2d100w

Obviously this is beyond what a typical game would ever really require, but it was fun to implement.

The format for dice rolls is <count>d<size>. You can also do (dis)advantage with either [b]est or [w]orst after the roll, followed by the number of best/worst rolls you want to keep.

For example: 6d8b4 to roll 6 d8s and keep the best 4.