diff --git a/discover_overlay/discord_connector.py b/discover_overlay/discord_connector.py index 89418d2..c13bc81 100644 --- a/discover_overlay/discord_connector.py +++ b/discover_overlay/discord_connector.py @@ -61,6 +61,8 @@ class DiscordConnector: self.text = [] self.authed = False self.last_rate_limit_send = 0 + self.muted = False + self.deafened = False self.socket_watch = None @@ -458,6 +460,8 @@ class DiscordConnector: elif j["cmd"] == "SELECT_VOICE_CHANNEL": return elif j["cmd"] == "SET_VOICE_SETTINGS": + self.muted = j['data']['mute'] + self.deafened = j['data']['deaf'] return elif j["cmd"] == "GET_VOICE_SETTINGS": return diff --git a/discover_overlay/discover_overlay.py b/discover_overlay/discover_overlay.py index f9e7269..705e7f0 100755 --- a/discover_overlay/discover_overlay.py +++ b/discover_overlay/discover_overlay.py @@ -114,8 +114,10 @@ class Discover: _("Send command, not start new instance.")) print(" --mute ", _("Set own user to mute")) print(" --unmute ", _("Set unmuted")) + print(" --toggle-mute ", _("Toggle muted")) print(" --deaf ", _("Set own user to deafened")) print(" --undeaf ", _("Unset user deafened state")) + print(" --toggle-deaf ", _("Toggle deaf")) print(" --moveto=XX ", _("Move the user into voice room, by Room ID")) print(" --minimized ", @@ -144,6 +146,12 @@ class Discover: if "--undeaf" in data: if self.connection: self.connection.set_deaf(False) + if "--toggle-mute" in data: + if self.connection: + self.connection.set_mute(not self.connection.muted) + if "--toggle-deaf" in data: + if self.connection: + self.connection.set_deaf(not self.connection.deafened) if "--refresh-guilds" in data: if self.connection: self.connection.req_guilds()