瀏覽代碼

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