ソースを参照

Add simple volume control

Frans Bergman 5 年 前
コミット
cebe1fd573
1 ファイル変更8 行追加0 行削除
  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