diff --git a/README.md b/README.md index 317b413..b4abfca 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [FAQ](#FAQ) | [Issues](https://github.com/jef/nvidia-snatcher/issues) | [Wiki](https://github.com/jef/nvidia-snatcher/wiki) +![nvidia-snatcher](media/screenshot.png) + The purpose of this bot is to get an Nvidia card. It tries multiple things to do that. - Currently, `nvidia-snatcher` is not capable of purchasing a card for you diff --git a/media/screenshot.png b/media/screenshot.png new file mode 100644 index 0000000..d7dd554 Binary files /dev/null and b/media/screenshot.png differ diff --git a/src/notification/sound.ts b/src/notification/sound.ts index 0867ae5..49f20b2 100644 --- a/src/notification/sound.ts +++ b/src/notification/sound.ts @@ -3,26 +3,28 @@ import {Logger} from '../logger'; import fs from 'fs'; import playerLib from 'play-sound'; -const notificationSound = Config.notifications.playSound; +let player: any; -const player = playerLib(); +if (Config.notifications.playSound) { + player = playerLib(); -if (player.player === null) { - Logger.warn('✖ couldn\'t find sound player'); -} else { - const playerName: string = player.player; - Logger.info(`✔ sound player found: ${playerName}`); + if (player.player === null) { + Logger.warn('✖ couldn\'t find sound player'); + } else { + const playerName: string = player.player; + Logger.info(`✔ sound player found: ${playerName}`); + } } export function playSound() { if (player.player !== null) { - fs.access(notificationSound, fs.constants.F_OK, error => { + fs.access(Config.notifications.playSound, fs.constants.F_OK, error => { if (error) { Logger.error(`✖ error opening sound file: ${error.message}`); return; } - player.play(notificationSound, (error: Error) => { + player.play(Config.notifications.playSound, (error: Error) => { if (error) { Logger.error('✖ couldn\'t play sound', error); }