Skip to content

Commit

Permalink
feat: events
Browse files Browse the repository at this point in the history
  • Loading branch information
BridgeSenseDev committed Feb 3, 2025
1 parent 3e1ad21 commit bf5eb9c
Show file tree
Hide file tree
Showing 6 changed files with 575 additions and 46 deletions.
12 changes: 12 additions & 0 deletions discord/interactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ func (client *Client) sendRequest(url string, payload map[string]interface{}) er
return err
}

func (client *Client) SendChatMessage(content string) error {
interactionsUrl := fmt.Sprintf("https://discord.com/api/v9/channels/%s/messages", client.ChannelID)

payload := map[string]interface{}{
"content": content,
"flags": 0,
"tts": false,
}

return client.sendRequest(interactionsUrl, payload)
}

func (client *Client) SendCommand(commandName string, options map[string]string) error {
sessionID, err := client.safeGetSessionID()
if err != nil {
Expand Down
Loading

0 comments on commit bf5eb9c

Please sign in to comment.