go-twitch/api/eventsub/delete_subscription.go

21 lines
354 B
Go
Raw Normal View History

2024-02-27 22:13:57 -05:00
package eventsub
import (
"net/http"
"net/url"
)
func (e *EventSub) DeleteSubscription(id string) error {
endpoint := e.baseUrl.ResolveReference(&url.URL{Path: "eventsub/subscriptions", RawQuery: "id=" + id})
_, err := e.client.Do(&http.Request{
Method: http.MethodDelete,
URL: endpoint,
})
if err != nil {
return err
}
return nil
}