Improve voice turns, local commands and Spotify controls
This commit is contained in:
@@ -25,6 +25,15 @@ export function quickAction(transcript) {
|
||||
success: result => result?.accepted === true && ['paused', 'stopped'].includes(result.status),
|
||||
};
|
||||
}
|
||||
if (text === 'громче' || text === 'тише') return {
|
||||
name: 'station_volume', args: { delta: text === 'громче' ? 10 : -10 }, done: 'Готово.',
|
||||
failure: 'Не удалось изменить громкость.', success: result => result?.ok === true,
|
||||
};
|
||||
const playback = { 'продолжи': 'resume', 'продолжай': 'resume', 'играй': 'resume', 'дальше':'next', 'следующий трек':'next', 'назад':'previous', 'предыдущий трек':'previous' }[text];
|
||||
if (playback) return {
|
||||
name: 'spotify_control', args: { action: playback }, done: 'Готово.',
|
||||
failure: 'Не удалось выполнить команду Spotify.', success: result => result?.accepted === true,
|
||||
};
|
||||
const match = text.match(/^(?:(?:поставь|установи|сделай) )?громкость(?: на| до)? (.+?)(?: ?%| процент(?:а|ов)?)?$/);
|
||||
if (!match) return null;
|
||||
const level = volumeLevel(match[1]);
|
||||
|
||||
Reference in New Issue
Block a user