Sfoglia il codice sorgente

Add simple volume control

Frans Bergman 5 anni fa
parent
commit
cebe1fd573
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 8 0
      main.rb

+ 8 - 0
main.rb

@@ -207,5 +207,13 @@ bot.command(:queue, description: "Lists the impending torture.") do |_event|
     queue.queue.each_with_index.map{|video, i| "#{i + 1}. #{format_title(video)}"}.join("\n")
 end
 
+bot.command(:volume, description: "Sets the severity of currently playing 'music'.") do |_event, volume|
+    next "Nothing is playing." unless _event.voice
+
+    _event.voice.volume = [volume.to_f, 1.5].min
+
+    ""
+end
+
 
 bot.run