1.2.0 • Published 1 year ago

discord.js-radio v1.2.0

Weekly downloads
-
License
UNLICENSE
Repository
github
Last release
1 year ago

discord.js-radio

An npm module that uses radio-browser to play a radio with discord.js

Disclaimer

This is an experimental module, do not expect this to work out of the box...

Example Usage

// In your main file
import { RadioPlayer } from 'discord.js-radio';
<Client>.radio = new RadioPlayer();

// In your command file

const member = <Interaction>.member as <GuildMember>;
const query = 'BBC Radio One'
const data = <Client>.radio.current()?.name || 'Unknown Radio';

try {
	await <Client>.radio.play({ query, voice: member.voice.channel! });
	if (<Client>.radio.playing) {
		const newData = <Client>.radio.current()?.name || 'Unknown Radio';
		return <Interaction>.reply({ content: `Switching to: **${newData}** from **${data}**` });
	}

	return <Interaction>.reply(`Now playing: **${data}**`);
} catch (error) {
	console.log(error);
	return <Interaction>.reply('No radios were found...');
}

License

Dedicated to the public domain via the Unlicense

1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.6

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago