Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
fixed smal inconsistency
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed May 25, 2021
1 parent eed6a2a commit 553f31c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions disgohook.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import (
"github.com/DisgoOrg/log"
)

func NewWebhookByToken(client *http.Client, logger log.Logger, webhookToken string) (api.WebhookClient, error) {
func NewWebhookClientByToken(httpClient *http.Client, logger log.Logger, webhookToken string) (api.WebhookClient, error) {
webhookTokenSplit := strings.SplitN(webhookToken, "/", 2)
if len(webhookTokenSplit) != 2 {
return nil, api.ErrMalformedWebhookToken
}
return NewWebhookByIDToken(client, logger, api.Snowflake(webhookTokenSplit[0]), webhookTokenSplit[1])
return NewWebhookClientByIDToken(httpClient, logger, api.Snowflake(webhookTokenSplit[0]), webhookTokenSplit[1])
}

func NewWebhookByIDToken(client *http.Client, logger log.Logger, webhookID api.Snowflake, webhookToken string) (api.WebhookClient, error) {
return internal.NewWebhookClientImpl(client, logger, webhookID, webhookToken), nil
func NewWebhookClientByIDToken(httpClient *http.Client, logger log.Logger, webhookID api.Snowflake, webhookToken string) (api.WebhookClient, error) {
return internal.NewWebhookClientImpl(httpClient, logger, webhookID, webhookToken), nil
}
2 changes: 1 addition & 1 deletion example/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func main() {
logger := logrus.New()
logger.SetLevel(logrus.DebugLevel)
logger.Info("starting example...")
webhook, err := disgohook.NewWebhookByToken(nil, logger, os.Getenv("webhook_token"))
webhook, err := disgohook.NewWebhookClientByToken(nil, logger, os.Getenv("webhook_token"))
if err != nil {
logger.Errorf("failed to create webhook: %s", err)
return
Expand Down

0 comments on commit 553f31c

Please sign in to comment.