mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 06:27:38 +00:00
feat(notification): add sound player executable option (#1301)
Pass the path to the player executable as a players array to play-sound so that it will check if the executable exists.
This commit is contained in:
@@ -270,6 +270,7 @@ const notifications = {
|
||||
channel: envOrString(process.env.SLACK_CHANNEL),
|
||||
token: envOrString(process.env.SLACK_TOKEN)
|
||||
},
|
||||
soundPlayer: envOrString(process.env.SOUND_PLAYER),
|
||||
telegram: {
|
||||
accessToken: envOrString(process.env.TELEGRAM_ACCESS_TOKEN),
|
||||
chatId: envOrArray(process.env.TELEGRAM_CHAT_ID)
|
||||
|
||||
@@ -6,7 +6,9 @@ import {logger} from '../logger';
|
||||
let player: PlaySound;
|
||||
|
||||
if (config.notifications.playSound) {
|
||||
player = playerLib();
|
||||
player = config.notifications.soundPlayer
|
||||
? playerLib({players: [config.notifications.soundPlayer]})
|
||||
: playerLib();
|
||||
|
||||
if (player.player === null) {
|
||||
logger.warn("✖ couldn't find sound player");
|
||||
|
||||
Reference in New Issue
Block a user