Link to NodeCG documentation for reference.
- [
object
]duration
[number
] How long the commercial will run for in seconds.
nodecg.listenFor('twitchCommercialStarted', 'nodecg-speedcontrol', (data) => {
...
});
{
duration: 180
}
Emitted when a Twitch commercial is successfully started via this bundle.
- [
object
]channelID
[string
orundefined
] Twitch channel ID (not name!) of the channel expecting it's metadata to be updated.title
[string
orundefined
] Title to be set.gameID
[string
] Twitch game/category ID (not name!) of the game to be set.
nodecg.listenFor('twitchExternalMetadata', 'nodecg-speedcontrol', (data) => {
...
});
{
channelID: '46573611',
title: 'Good Games Marathon Continues',
gameID: '1316'
}
Emitted when the Twitch metadata (title/game) should be updated, either automatically or via the Twitch Control panel, only if twitch.metadataUseExternal
is set to true in the bundle configuration. Only needed if you need to use an alternative script to change this instead of the default integration.
- [
object
]duration
[number
] How long the commercial should run for in seconds.fromDashboard
[boolean
] If this message was triggered manually via a dashboard panel; internally used on the Twitch Control panel.
nodecg.listenFor('twitchExternalCommercial', 'nodecg-speedcontrol', (data) => {
...
});
{
duration: 180,
fromDashboard: false
}
Emmited when a commercial should be ran, either automatically or via the Twitch Control panel, only if twitch.commercialsUseExternal
is set to true in the bundle configuration. Only needed if you need to use an alternative script to start commercials instead of the default integration.
names
[array
[string
]] List of Twitch usernames.
nodecg.listenFor('repeaterFeaturedChannels', 'nodecg-speedcontrol', (names) => {
...
});
[
'zoton2',
'ontwoplanks'
]
Emitted when the featured channels should be updated, either automatically or via the Twitch Control panel, only if twitch.ffzUseRepeater
is set to true in the bundle configuration. Only needed if you need to use an alternative script to update these instead of the default integration.
Link to NodeCG documentation for reference.
nodecg.sendMessageToBundle('timerStart', 'nodecg-speedcontrol');
nodecg.sendMessageToBundle('timerStart', 'nodecg-speedcontrol', (err) => {
...
});
nodecg.sendMessageToBundle('timerStart', 'nodecg-speedcontrol')
.then(() => { ... })
.catch((err) => { ... });
Will start the timer, or resume it if it was paused. This will only work if the timer is "stopped"
or "paused"
, and the timerChangesDisabled
replicant is set to false
.
nodecg.sendMessageToBundle('timerPause', 'nodecg-speedcontrol');
nodecg.sendMessageToBundle('timerPause', 'nodecg-speedcontrol', (err) => {
...
});
nodecg.sendMessageToBundle('timerPause', 'nodecg-speedcontrol')
.then(() => { ... })
.catch((err) => { ... });
Will pause the timer. This will only work if the timer is "running"
, and the timerChangesDisabled
replicant is set to false
.
force
[boolean
] (default:false
) Will reset the timer even if thetimerChangesDisabled
replicant is set totrue
.
nodecg.sendMessageToBundle('timerReset', 'nodecg-speedcontrol', false);
nodecg.sendMessageToBundle('timerReset', 'nodecg-speedcontrol', false, (err) => {
...
});
nodecg.sendMessageToBundle('timerReset', 'nodecg-speedcontrol', false)
.then(() => { ... })
.catch((err) => { ... });
Will fully reset the timer. This will only work if the timer is not "stopped"
, and the timerChangesDisabled
replicant is set to false
(unless force
is true
).
- [
object
]id
[string
orundefined
] Team ID to stop timer of; must be defined if run is active and has teams.forfeit
[boolean
] (default:false
) If true, the finish time will be recorded as"forfeit"
instead of"completed"
.
nodecg.sendMessageToBundle('timerStop', 'nodecg-speedcontrol', {
id: '18341eb2-eb45-4184-98f6-e74baafaf71a',
forfeit: false
});
nodecg.sendMessageToBundle('timerStop', 'nodecg-speedcontrol', {
id: '18341eb2-eb45-4184-98f6-e74baafaf71a',
forfeit: false
}, (err) => {
...
});
nodecg.sendMessageToBundle('timerStop', 'nodecg-speedcontrol', {
id: '18341eb2-eb45-4184-98f6-e74baafaf71a',
forfeit: false
})
.then(() => { ... })
.catch((err) => { ... });
Will stop the timer for the specified team ID. This must be supplied if there is a run active and it has any teams, otherwise it'll fail. This will only work if the timer is "running"
, and the timerChangesDisabled
replicant is set to false
. If the timer is "running"
and the team you specify is the only one left to finish, this will automatically set it to "finished"
.
id
[string
orundefined
] Team ID to undo timer of; must be defined if run is active and has teams.
nodecg.sendMessageToBundle('timerUndo', 'nodecg-speedcontrol', '18341eb2-eb45-4184-98f6-e74baafaf71a');
nodecg.sendMessageToBundle('timerUndo', 'nodecg-speedcontrol', '18341eb2-eb45-4184-98f6-e74baafaf71a', (err) => {
...
});
nodecg.sendMessageToBundle('timerUndo', 'nodecg-speedcontrol','18341eb2-eb45-4184-98f6-e74baafaf71a')
.then(() => { ... })
.catch((err) => { ... });
Will undo a stopped timer for the specified team ID. This must be supplied if there is a run active and it has any teams, otherwise it'll fail. This will only work if the timer is "finished"
or "running"
, and the timerChangesDisabled
replicant is set to false
. If the timer is "finished"
, this will automatically return it to "running"
.
time
[string
] Time to set timer at; should be in the format"HH:MM:SS"
.
nodecg.sendMessageToBundle('timerEdit', 'nodecg-speedcontrol', '01:37:23');
nodecg.sendMessageToBundle('timerEdit', 'nodecg-speedcontrol', '01:37:23', (err) => {
...
});
nodecg.sendMessageToBundle('timerEdit', 'nodecg-speedcontrol', '01:37:23')
.then(() => { ... })
.catch((err) => { ... });
Will edit the timer to the specified time. This will only work if the timer is "paused"
or "stopped"
, and the timerChangesDisabled
replicant is set to false
.
noTwitchGame
[boolean
] If the Twitch integration is enabled, auto-sync is turned on and the Twitch directory could not be set automatically, this will returntrue
.
nodecg.sendMessageToBundle('changeToNextRun', 'nodecg-speedcontrol');
nodecg.sendMessageToBundle('changeToNextRun', 'nodecg-speedcontrol', (err, noTwitchGame) => {
...
});
nodecg.sendMessageToBundle('changeToNextRun', 'nodecg-speedcontrol')
.then((noTwitchGame) => { ... })
.catch((err) => { ... });
false
Will move to the next run if possible; this is the same as pressing the "next game" button on the Run Player panel. This will only work if the timer is not "running"
or "paused"
.
id
[string
] ID of the run you wish to change to.
noTwitchGame
[boolean
] If the Twitch integration is enabled, auto-sync is turned on and the Twitch directory could not be set automatically, this will returntrue
.
nodecg.sendMessageToBundle('changeActiveRun', 'nodecg-speedcontrol', '889e22d3-d1ef-40b8-8b2a-1d7eabf84755');
nodecg.sendMessageToBundle('changeActiveRun', 'nodecg-speedcontrol', '889e22d3-d1ef-40b8-8b2a-1d7eabf84755', (err, noTwitchGame) => {
...
});
nodecg.sendMessageToBundle('changeActiveRun', 'nodecg-speedcontrol', '889e22d3-d1ef-40b8-8b2a-1d7eabf84755')
.then((noTwitchGame) => { ... })
.catch((err) => { ... });
false
Will change to the run with the ID supplied if possible; this is the same as pressing the "play" button on a specific run on the Run Player panel. This will only work if the timer is not "running"
or "paused"
.
- [
object
]runData
[object
] ArunData
object (relevant link:runData
Object Structure).prevID
[string
orundefined
] If supplied and run is new, run will be added after the run with this ID.updateTwitch
[boolean
] (default:false
) If Twitch integration is enabled and this istrue
, we will attempt to update the Twitch information with this run data.
noTwitchGame
[boolean
] If the Twitch integration is enabled,updateTwitch
was set totrue
and the Twitch directory could not be set automatically, this will returntrue
.
nodecg.sendMessageToBundle('modifyRun', 'nodecg-speedcontrol', {
runData: { /* runData object */ },
prevID: '889e22d3-d1ef-40b8-8b2a-1d7eabf84755',
updateTwitch: false
});
nodecg.sendMessageToBundle('modifyRun', 'nodecg-speedcontrol', {
runData: { /* runData object */ },
prevID: '889e22d3-d1ef-40b8-8b2a-1d7eabf84755',
updateTwitch: false
}, (err, noTwitchGame) => {
...
});
nodecg.sendMessageToBundle('modifyRun', 'nodecg-speedcontrol', {
runData: { /* runData object */ },
prevID: '889e22d3-d1ef-40b8-8b2a-1d7eabf84755',
updateTwitch: false
})
.then((noTwitchGame) => { ... })
.catch((err) => { ... });
false
Will either edit a run (if runData
has an ID we already have added) or add a new run to the runDataArray
replicant. If the run is also the active run, this will be updated as well.
- [
object
]runID
[string
] ID of the run you wish to switch the active relay player for.teamID
[string
] ID of the team you wish to switch the active relay player for.playerID
[string
] ID of the player you wish to switch the active relay player to.
nodecg.sendMessageToBundle('modifyRelayPlayerID', 'nodecg-speedcontrol', {
runID: 'f926048c-3527-4d2f-96f6-680b81bf06e6',
teamID: 'f926048c-3527-4d2f-96f6-680b81bf06e6',
playerID: '26a6dc65-7f39-4f33-a263-56be74bed783'
});
nodecg.sendMessageToBundle('modifyRelayPlayerID', 'nodecg-speedcontrol', {
runID: 'f926048c-3527-4d2f-96f6-680b81bf06e6',
teamID: 'f926048c-3527-4d2f-96f6-680b81bf06e6',
playerID: '26a6dc65-7f39-4f33-a263-56be74bed783'
}, (err) => {
...
});
nodecg.sendMessageToBundle('modifyRelayPlayerID', 'nodecg-speedcontrol', {
runID: 'f926048c-3527-4d2f-96f6-680b81bf06e6',
teamID: 'f926048c-3527-4d2f-96f6-680b81bf06e6',
playerID: '26a6dc65-7f39-4f33-a263-56be74bed783'
})
.then(() => { ... })
.catch((err) => { ... });
Will change the currently active relay player for the specified team inside the specified run. Only applicable if the run is marked as a relay.
id
[string
] The ID of the run you wish to remove.
nodecg.sendMessageToBundle('removeRun', 'nodecg-speedcontrol', '889e22d3-d1ef-40b8-8b2a-1d7eabf84755');
nodecg.sendMessageToBundle('removeRun', 'nodecg-speedcontrol', '889e22d3-d1ef-40b8-8b2a-1d7eabf84755', (err) => {
...
});
nodecg.sendMessageToBundle('removeRun', 'nodecg-speedcontrol', '889e22d3-d1ef-40b8-8b2a-1d7eabf84755')
.then(() => { ... })
.catch((err) => { ... });
Will remove the run with the supplied ID from the runDataArray
replicant. This will not remove the active run if this ID happens to be the same.
nodecg.sendMessageToBundle('returnToStart', 'nodecg-speedcontrol');
nodecg.sendMessageToBundle('returnToStart', 'nodecg-speedcontrol', (err) => {
...
});
nodecg.sendMessageToBundle('returnToStart', 'nodecg-speedcontrol')
.then(() => { ... })
.catch((err) => { ... });
Will return the marathon schedule to the start; internally this just removes the active run. This will only work if the timer is not "running"
or "paused"
.
nodecg.sendMessageToBundle('removeAllRuns', 'nodecg-speedcontrol');
nodecg.sendMessageToBundle('removeAllRuns', 'nodecg-speedcontrol', (err) => {
...
});
nodecg.sendMessageToBundle('removeAllRuns', 'nodecg-speedcontrol')
.then(() => { ... })
.catch((err) => { ... });
Removes all of the runs in the runDataArray
replicant, and also removes the active run. The timer is also reset if needed. This will only work if the timer is not "running"
or "paused"
.
- [
object
]duration
[number
] (default:180
) How long you want the commercial to run for in seconds; if not supplied will default to 180s/3m.fromDashboard
[boolean
] (default:false
) If this message was triggered manually via a dashboard panel; internally used on the Twitch Control panel, for passing on via thetwitchExternalCommercial
message, if you use this.
- [
object
]duration
[number
] How long the commercial will run for in seconds.fromDashboard
[boolean
] If the commercial was triggered via a dashboard panel (see comment above for use cases).
nodecg.sendMessageToBundle('twitchStartCommercial', 'nodecg-speedcontrol', { duration: 180, fromDashboard: false });
nodecg.sendMessageToBundle('twitchStartCommercial', 'nodecg-speedcontrol', { duration: 180, fromDashboard: false }, (err, data) => {
...
});
nodecg.sendMessageToBundle('twitchStartCommercial', 'nodecg-speedcontrol', { duration: 180, fromDashboard: false })
.then((data) => { ... })
.catch((err) => { ... });
{
duration: 180,
fromDashboard: false
}
Used to tell the Twitch API to run a commercial if applicable to your channel and you have the Twitch API integration enabled. You can specify the length using duration
in the paramters object; if not specified it will default to 180.
- [
object
]duration
[number
] How long you want the commercial timer to run for in seconds.
nodecg.sendMessageToBundle('twitchStartCommercialTimer', 'nodecg-speedcontrol', { duration: 180 });
nodecg.sendMessageToBundle('twitchStartCommercialTimer', 'nodecg-speedcontrol', { duration: 180 }, (err, data) => {
...
});
nodecg.sendMessageToBundle('twitchStartCommercialTimer', 'nodecg-speedcontrol', { duration: 180 })
.then((data) => { ... })
.catch((err) => { ... });
Does not run a commercial! Used to manually start the in-built "commercial timer" that will disable the commercial buttons in the dashboard and display the countdown, and also update the twitchCommercialTimer
replicant. This may be useful if you also have external services running commercials on the Twitch channel but also use this bundle to run them as well, and wish to show that information to users on NodeCG and your other bundles.
- [
object
]status
[string
orundefined
] What the title should be set to; if not supplied, will not be changed.game
[string
orundefined
] Directory on Twitch to set channel to; if not supplied, will be set to the default (configurable in the bundle configuration).
noTwitchGame
[boolean
] If the suppliedgame
is not a valid directory on Twitch, this will returntrue
.
nodecg.sendMessageToBundle('twitchUpdateChannelInfo', 'nodecg-speedcontrol', {
status: 'Good Games Marathon Continues',
game: 'Miami Vice'
});
nodecg.sendMessageToBundle('twitchUpdateChannelInfo', 'nodecg-speedcontrol', {
status: 'Good Games Marathon Continues',
game: 'Miami Vice'
}, (err, noTwitchGame) => {
...
});
nodecg.sendMessageToBundle('twitchUpdateChannelInfo', 'nodecg-speedcontrol', {
status: 'Good Games Marathon Continues',
game: 'Miami Vice'
})
.then((noTwitchGame) => { ... })
.catch((err) => { ... });
false
Used to update the Twitch status (title) and/or game (directory), if the integration is enabled. This is the same as changing it via the Twitch Control panel.
Notes about this message:
- Internally we use the needle package, so their documentation may be of help for this message.
- This can be used via the NodeCG messaging system, although if used in an extension you should use our messaging service so you can actually get a proper response.
- You may need to add an
additionalScope
to the relevant configuration.
- [
object
]method
[string
] Request HTTP type:"get"
/"head"
/"delete"
/"patch"
/"post"
/"put"
.endpoint
[string
] Endpoint you wish to request.data
[object
(usually) orundefined
] Data, if any, to be sent alongside this request.newAPI
[boolean
] (default:false
) If this request is for Twitch's "new" API; if false it will request on the (now deprecated) v5 API.
response
[object
] The received response; see the needle documentation for more information.
nodecg.sendMessageToBundle('twitchAPIRequest', 'nodecg-speedcontrol', {
method: 'get',
endpont: '/streams/markers',
data: {
user_id: '123',
description: 'hello, this is a marker!'
},
newAPI: true
});
nodecg.sendMessageToBundle('twitchAPIRequest', 'nodecg-speedcontrol', {
method: 'get',
endpont: '/streams/markers',
data: {
user_id: '123',
description: 'hello, this is a marker!'
},
newAPI: true
}, (err, response) => {
...
});
nodecg.sendMessageToBundle('twitchAPIRequest', 'nodecg-speedcontrol', {
method: 'get',
endpont: '/streams/markers',
data: {
user_id: '123',
description: 'hello, this is a marker!'
},
newAPI: true
})
.then((response) => { ... })
.catch((err) => { ... });
See the needle documentation.
Allows you to use the Twitch API implementation in this bundle to do your own requests if needed. You may need to add additional scopes in the configuration if you need more authorisation than we provide by default to make your request. Supports either the v5 API or the "new" API via a boolean flag; you should use the "new" API if possible as v5 is now deprecated and newly registered applications cannot access it!
names
[array
[string
]] List of Twitch usernames to use.
nodecg.sendMessageToBundle('updateFeaturedChannels', 'nodecg-speedcontrol', [
'zoton2',
'ontwoplanks'
]);
nodecg.sendMessageToBundle('updateFeaturedChannels', 'nodecg-speedcontrol', [
'zoton2',
'ontwoplanks'
], (err) => {
...
});
nodecg.sendMessageToBundle('updateFeaturedChannels', 'nodecg-speedcontrol',[
'zoton2',
'ontwoplanks'
])
.then(() => { ... })
.catch((err) => { ... });
Used to update the featured channels, if the integration is enabled. This is the same as changing it via the Twitch Control panel. If you wish to not list any, supply an empty array.