diff --git a/discord/discord.go b/discord/discord.go index 3d764f0..b79a427 100644 --- a/discord/discord.go +++ b/discord/discord.go @@ -88,13 +88,13 @@ func SelectMemberNotInState(s State) int { } func SetUserDead(id int) { - if id == -1 { SelectMemberInState(Alive) } + if id == -1 { id = SelectMemberInState(Alive) } if id == -1 { return } SetUserState(id, Dead) } func SetUserState(id int, s State) { - if id == -1 { SelectMemberNotInState(s) } + if id == -1 { id = SelectMemberNotInState(s) } if id == -1 { return } MemberState[id] = s } @@ -121,7 +121,7 @@ func StateName(s State) string { } func MuteUser(id int) { - if id == -1 { SelectMemberNotInState(Offline) } + if id == -1 { id = SelectMemberNotInState(Offline) } if id == -1 { return } Session.GuildMemberMute(Conf.GuildID, Members[id].User.ID, true) } @@ -135,7 +135,7 @@ func MuteState(s State) { } func UnmuteUser(id int) { - if id == -1 { SelectMemberNotInState(Offline) } + if id == -1 { id = SelectMemberNotInState(Offline) } if id == -1 { return } Session.GuildMemberMute(Conf.GuildID, Members[id].User.ID, false) } diff --git a/parser/mute.go b/parser/mute.go index 1082e55..3bcd926 100644 --- a/parser/mute.go +++ b/parser/mute.go @@ -18,8 +18,9 @@ func muteParser(cmd string) { case '1': fmt.Println("Muting User:") discord.MuteUser(-1) - } - if cmd[1:] != "" { + case '+': + fmt.Println("Muting Alive:") + discord.MuteState(discord.Alive) Parse(cmd[1:]) } } diff --git a/parser/state.go b/parser/state.go index 163c9b7..4b702a9 100644 --- a/parser/state.go +++ b/parser/state.go @@ -17,8 +17,9 @@ func aliveParser(cmd string) { case '1': fmt.Println("Adding to Alive:") discord.SetUserState(-1, discord.Alive) - } - if cmd[1:] != "" { + case '+': + fmt.Println("All Users:") + discord.ListMembersNotInState(discord.Offline) Parse(cmd[1:]) } } @@ -36,8 +37,9 @@ func deadParser(cmd string) { case '1': fmt.Println("Adding to Deadlist") discord.SetUserDead(-1) - } - if cmd[1:] != "" { + case '+': + fmt.Println("Deadlist:") + discord.ListMembersInState(discord.Dead) Parse(cmd[1:]) } } @@ -54,8 +56,9 @@ func offlineParser(cmd string) { case '1': fmt.Println("Adding to Offline") discord.SetUserState(-1, discord.Offline) - } - if cmd[1:] != "" { + case '+': + fmt.Println("Offline Users:") + discord.ListMembersInState(discord.Offline) Parse(cmd[1:]) } } diff --git a/parser/unmute.go b/parser/unmute.go index f07082a..e883637 100644 --- a/parser/unmute.go +++ b/parser/unmute.go @@ -18,8 +18,9 @@ func unmuteParser(cmd string) { case '1': fmt.Println("Unmuting User:") discord.UnmuteUser(-1) - } - if cmd[1:] != "" { + case '+': + fmt.Println("Unmuting Alive:") + discord.UnmuteState(discord.Alive) Parse(cmd[1:]) } }