diff --git a/main.rb b/main.rb index cca2803..c9fa5e0 100644 --- a/main.rb +++ b/main.rb @@ -28,7 +28,7 @@ if File.exists?("/usr/bin/mpd") puts "Bailing since mpd exists but not mpc (which is needed to control mpd)" exit end - if mpc.running + if mpc.running? puts "starting mpd if not already running" `systemctl start mpd` unless `ps aux | grep mpd` != "" mpc.reset @@ -103,12 +103,12 @@ end puts("logging into discord") bot.run(true) puts("starting main loop") -timer = 5 +timer = 30 loop do sleep timer if !mpc.playing? + bot.online current = mpc.nowplaying - puts("listening to #{current}") status = bot.listening=current if status != current puts("tried to update listening status but got #{status} back")