You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
652 B
Ruby

def volumeMusic_getCommand()
return ["volume", "volumeMusic_main"]
end
def volumeMusic_main(event)
message = event.content
arguments = message.sub(/(!volume)/i, '').chomp
if arguments == ''
event.respond "Please add a volume from 1-200"
else
voice_channel = event.author.voice_channel.id
if ENV["#{voice_channel}"] == 'playing'
volVal = arguments.split.first.to_f
voiceBot = $voicebots[voice_channel]
volVal = volVal / 100
puts volVal
voiceBot.volume = volVal
volVal = volVal * 100
str = "Setting currently playing volume to " + volVal.to_s
event.respond str
else
event.respond "Bot not playing!"
end
end
end