Skip to content

Commit

Permalink
feat: Add SendRawGatewayMessage function
Browse files Browse the repository at this point in the history
Signed-off-by: Mia <[email protected]>
  • Loading branch information
K3das committed Jul 21, 2023
1 parent e39e715 commit aa9dacf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions wsapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,21 @@ func (s *Session) RequestGuildMembersBatchList(guildIDs []string, userIDs []stri
return
}

// SendRawGatewayMessage allows for sending raw gateway messages untouched by discordgo.
func (s *Session) SendRawGatewayMessage(data interface{}) (err error) {
s.RLock()
defer s.RUnlock()
if s.wsConn == nil {
return ErrWSNotFound
}

s.wsMutex.Lock()
err = s.wsConn.WriteJSON(data)
s.wsMutex.Unlock()

return err
}

func (s *Session) requestGuildMembers(data requestGuildMembersData) (err error) {
s.log(LogInformational, "called")

Expand Down

0 comments on commit aa9dacf

Please sign in to comment.