Fix various Discord-related things.
parent
c97297043a
commit
1a669e7834
|
@ -7,7 +7,7 @@ require 'streamio-ffmpeg'
|
||||||
# @!visibility private
|
# @!visibility private
|
||||||
class QueueItem
|
class QueueItem
|
||||||
attr_accessor :next, :prev
|
attr_accessor :next, :prev
|
||||||
attr_reader :time, :ptime, :size, :fname, :descr, :is_stream
|
attr_reader :time, :ptime, :size, :fname, :url, :descr, :is_stream
|
||||||
|
|
||||||
def initialize uri, stream = false
|
def initialize uri, stream = false
|
||||||
@is_stream = stream
|
@is_stream = stream
|
||||||
|
@ -19,7 +19,7 @@ class QueueItem
|
||||||
@fname = uri.to_s
|
@fname = uri.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
@descr = uri.to_s
|
@url = uri.to_s
|
||||||
|
|
||||||
unless @is_stream
|
unless @is_stream
|
||||||
if (mov = FFMPEG::Movie.new(@fname)) and mov.valid?
|
if (mov = FFMPEG::Movie.new(@fname)) and mov.valid?
|
||||||
|
@ -29,6 +29,8 @@ class QueueItem
|
||||||
else
|
else
|
||||||
throw ArgumentError, "File is invalid or is a stream."
|
throw ArgumentError, "File is invalid or is a stream."
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
@descr = @url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -71,12 +73,12 @@ class Mod_Audio < Vrobot4::Module::Module
|
||||||
super
|
super
|
||||||
register :c_join, "voicejoin", "Brings the bot to your voice channel."
|
register :c_join, "voicejoin", "Brings the bot to your voice channel."
|
||||||
register :c_quit, "voicequit", "Kicks the bot from voice.", roles: "h"
|
register :c_quit, "voicequit", "Kicks the bot from voice.", roles: "h"
|
||||||
register :c_queue, "queue", "Adds an item to the queue or lists it."
|
register :c_queue, "queue", "Adds an item to the queue or lists it."
|
||||||
register :c_volume, "volume", "Sets the bot's volume."
|
register :c_volume, "volume", "Sets the bot's volume."
|
||||||
register :c_skip, "skip", "Skips to the next song."
|
register :c_skip, "skip", "Skips to the next song."
|
||||||
register :c_pause, "pause", "Pauses the current song."
|
register :c_pause, "pause", "Pauses the current song."
|
||||||
register :c_play, "play", "Resumes the current song."
|
register :c_play, "play", "Resumes the current song."
|
||||||
register :c_rmqueue, "rmqueue", "Removes an item from the queue."
|
register :c_rmqueue, "rmqueue", "Removes an item from the queue."
|
||||||
# TODO: add stream playing command
|
# TODO: add stream playing command
|
||||||
@queue = []
|
@queue = []
|
||||||
@queue_mtx = Mutex.new
|
@queue_mtx = Mutex.new
|
||||||
|
|
|
@ -15,7 +15,6 @@ class Mod_Discord < Vrobot4::Module::Module
|
||||||
end
|
end
|
||||||
|
|
||||||
def c_purge m, argv
|
def c_purge m, argv
|
||||||
check_args argv, "N"
|
|
||||||
n = argv.to_i
|
n = argv.to_i
|
||||||
n = 2 if n < 2
|
n = 2 if n < 2
|
||||||
n = 100 if n > 100
|
n = 100 if n > 100
|
||||||
|
|
Loading…
Reference in New Issue