Skip to content

Commit

Permalink
always show bot as deaf
Browse files Browse the repository at this point in the history
  • Loading branch information
andersfylling committed May 28, 2020
1 parent bd5e314 commit e423673
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions gateway_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ type UpdateVoiceStatePayload struct {
SelfMute bool

// SelfDeaf is the Client deafened
// Currently, it's n ot documented how to receive sound from discord
// therefore it's not supported and the bot is always going to be deaf.
//
// deprecated, this is always true
SelfDeaf bool
}

Expand Down
6 changes: 3 additions & 3 deletions voiceconnection.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func newVoiceRepository(c *Client) (voice *voiceRepository) {
}

func (r *voiceRepository) VoiceConnect(guildID, channelID Snowflake) (VoiceConnection, error) {
return r.VoiceConnectOptions(guildID, channelID, false, false)
return r.VoiceConnectOptions(guildID, channelID, true, false)
}

func (r *voiceRepository) VoiceConnectOptions(guildID, channelID Snowflake, selfDeaf, selfMute bool) (ret VoiceConnection, err error) {
Expand Down Expand Up @@ -115,7 +115,7 @@ func (r *voiceRepository) VoiceConnectOptions(guildID, channelID Snowflake, self
_, err = r.c.Emit(UpdateVoiceState, &UpdateVoiceStatePayload{
GuildID: guildID,
ChannelID: channelID,
SelfDeaf: selfDeaf,
SelfDeaf: true, //selfDeaf,
SelfMute: selfMute,
})
if err != nil {
Expand Down Expand Up @@ -349,7 +349,7 @@ func (v *voiceImpl) MoveTo(channelID Snowflake) error {
_, _ = v.c.Emit(UpdateVoiceState, &UpdateVoiceStatePayload{
GuildID: v.guildID,
ChannelID: channelID,
SelfDeaf: false,
SelfDeaf: true, //false,
SelfMute: false,
})

Expand Down

0 comments on commit e423673

Please sign in to comment.