- Added toggle for mute & deaf

This commit is contained in:
trigg 2025-05-04 14:40:27 +01:00
parent 4b7d6f6a1c
commit ff1cc22515
2 changed files with 12 additions and 0 deletions

View file

@ -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

View file

@ -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()