-
Notifications
You must be signed in to change notification settings - Fork 4
/
stream2icecast.js
42 lines (39 loc) · 1.2 KB
/
stream2icecast.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
registerPlugin({
name: 'stream2icecast',
version: '1.0.1',
description: 'Streams the bots audio to an icecast server.',
author: 'SinusBot Team',
backends: ['ts3', 'discord'],
vars: [
// **DO NOT EDIT THIS HERE**
// Restart the sinusbot, then enable and configure it in the webinterface.
{
name: 'streamServer',
title: 'StreamServer URL',
type: 'string',
placeholder: 'http://something.example.com:8000/example'
},
{
name: 'streamUser',
title: 'User',
type: 'string'
},
{
name: 'streamPassword',
title: 'Password',
type: 'password'
}
]
}, (_, config, meta) => {
const engine = require('engine');
const audio = require('audio');
engine.log(`Loaded ${meta.name} v${meta.version} by ${meta.author}.`);
if (!config.streamUser) {
config.streamUser = 'source';
}
if (config.streamServer && config.streamPassword) {
audio.streamToServer(config.streamServer, config.streamUser, config.streamPassword);
} else {
engine.log('URL or Password missing!');
}
});