diff --git a/commands.go b/commands.go
index 4be4eeb..5dde0c4 100644
--- a/commands.go
+++ b/commands.go
@@ -43,28 +43,28 @@ func parseCommand(user *gumble.User, username, command string) {
// Skip command
case dj.conf.Aliases.SkipAlias:
if dj.HasPermission(username, dj.conf.Permissions.AdminSkip) {
- skip(user, username, false, false)
+ skip(user, false, false)
} else {
dj.SendPrivateMessage(user, NO_PERMISSION_MSG)
}
// Skip playlist command
case dj.conf.Aliases.SkipPlaylistAlias:
if dj.HasPermission(username, dj.conf.Permissions.AdminAddPlaylists) {
- skip(user, username, false, true)
+ skip(user, false, true)
} else {
dj.SendPrivateMessage(user, NO_PERMISSION_MSG)
}
// Forceskip command
case dj.conf.Aliases.AdminSkipAlias:
if dj.HasPermission(username, true) {
- skip(user, username, true, false)
+ skip(user, true, false)
} else {
dj.SendPrivateMessage(user, NO_PERMISSION_MSG)
}
// Playlist forceskip command
case dj.conf.Aliases.AdminSkipPlaylistAlias:
if dj.HasPermission(username, true) {
- skip(user, username, true, true)
+ skip(user, true, true)
} else {
dj.SendPrivateMessage(user, NO_PERMISSION_MSG)
}
@@ -78,7 +78,7 @@ func parseCommand(user *gumble.User, username, command string) {
// Volume command
case dj.conf.Aliases.VolumeAlias:
if dj.HasPermission(username, dj.conf.Permissions.AdminVolume) {
- volume(user, username, argument)
+ volume(user, argument)
} else {
dj.SendPrivateMessage(user, NO_PERMISSION_MSG)
}
@@ -177,19 +177,19 @@ func add(user *gumble.User, url string) error {
// skip performs !skip functionality. Adds a skip to the skippers slice for the current song, and then
// evaluates if a skip should be performed. Both skip and forceskip are implemented here.
-func skip(user *gumble.User, username string, admin, playlistSkip bool) {
+func skip(user *gumble.User, admin, playlistSkip bool) {
if dj.audioStream.IsPlaying() {
if playlistSkip {
if dj.queue.CurrentSong().Playlist() != nil {
- if err := dj.queue.CurrentSong().Playlist().AddSkip(username); err == nil {
+ if err := dj.queue.CurrentSong().Playlist().AddSkip(user.Name); err == nil {
submitterSkipped := false
if admin {
dj.client.Self.Channel.Send(ADMIN_PLAYLIST_SKIP_MSG, false)
- } else if dj.queue.CurrentSong().Submitter() == username {
- dj.client.Self.Channel.Send(fmt.Sprintf(PLAYLIST_SUBMITTER_SKIP_HTML, username), false)
+ } else if dj.queue.CurrentSong().Submitter() == user.Name {
+ dj.client.Self.Channel.Send(fmt.Sprintf(PLAYLIST_SUBMITTER_SKIP_HTML, user.Name), false)
submitterSkipped = true
} else {
- dj.client.Self.Channel.Send(fmt.Sprintf(PLAYLIST_SKIP_ADDED_HTML, username), false)
+ dj.client.Self.Channel.Send(fmt.Sprintf(PLAYLIST_SKIP_ADDED_HTML, user.Name), false)
}
if submitterSkipped || dj.queue.CurrentSong().Playlist().SkipReached(len(dj.client.Self.Channel.Users)) || admin {
id := dj.queue.CurrentSong().Playlist().ID()
@@ -218,15 +218,15 @@ func skip(user *gumble.User, username string, admin, playlistSkip bool) {
dj.SendPrivateMessage(user, NO_PLAYLIST_PLAYING_MSG)
}
} else {
- if err := dj.queue.CurrentSong().AddSkip(username); err == nil {
+ if err := dj.queue.CurrentSong().AddSkip(user.Name); err == nil {
submitterSkipped := false
if admin {
dj.client.Self.Channel.Send(ADMIN_SONG_SKIP_MSG, false)
- } else if dj.queue.CurrentSong().Submitter() == username {
- dj.client.Self.Channel.Send(fmt.Sprintf(SUBMITTER_SKIP_HTML, username), false)
+ } else if dj.queue.CurrentSong().Submitter() == user.Name {
+ dj.client.Self.Channel.Send(fmt.Sprintf(SUBMITTER_SKIP_HTML, user.Name), false)
submitterSkipped = true
} else {
- dj.client.Self.Channel.Send(fmt.Sprintf(SKIP_ADDED_HTML, username), false)
+ dj.client.Self.Channel.Send(fmt.Sprintf(SKIP_ADDED_HTML, user.Name), false)
}
if submitterSkipped || dj.queue.CurrentSong().SkipReached(len(dj.client.Self.Channel.Users)) || admin {
if !(submitterSkipped || admin) {
@@ -251,7 +251,7 @@ func help(user *gumble.User) {
// volume performs !volume functionality. Checks input value against LowestVolume and HighestVolume from
// config to determine if the volume should be applied. If in the correct range, the new volume
// is applied and is immediately in effect.
-func volume(user *gumble.User, username, value string) {
+func volume(user *gumble.User, value string) {
if value == "" {
dj.client.Self.Channel.Send(fmt.Sprintf(CUR_VOLUME_HTML, dj.audioStream.Volume), false)
} else {
@@ -259,7 +259,7 @@ func volume(user *gumble.User, username, value string) {
newVolume := float32(parsedVolume)
if newVolume >= dj.conf.Volume.LowestVolume && newVolume <= dj.conf.Volume.HighestVolume {
dj.audioStream.Volume = newVolume
- dj.client.Self.Channel.Send(fmt.Sprintf(VOLUME_SUCCESS_HTML, username, dj.audioStream.Volume), false)
+ dj.client.Self.Channel.Send(fmt.Sprintf(VOLUME_SUCCESS_HTML, user.Name, dj.audioStream.Volume), false)
} else {
dj.SendPrivateMessage(user, fmt.Sprintf(NOT_IN_VOLUME_RANGE_MSG, dj.conf.Volume.LowestVolume, dj.conf.Volume.HighestVolume))
}
diff --git a/index.html b/index.html
index 528d85d..9ef2b91 100644
--- a/index.html
+++ b/index.html
@@ -12,13 +12,13 @@
function addURL() {
var url = $("#textbox");
$.ajax(api("add") + "&value=" + url.attr("value"));
- url.value = "";
+ url.attr("value", "");
}
function volume() {
var volume = $("#textbox");
$.ajax(api("volume") + "&value=" + volume.attr("value"));
- volume.value = "";
+ volume.attr("value", "");
}
function skip(val) {
@@ -32,7 +32,7 @@
-
-
+
+