Skip to content

Commit

Permalink
Remove pointless named return values
Browse files Browse the repository at this point in the history
  • Loading branch information
sebm253 committed Oct 8, 2024
1 parent e8ae7a3 commit 1c388db
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions rest/webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ func (s *webhookImpl) UpdateWebhook(webhookID snowflake.ID, webhookUpdate discor
return
}

func (s *webhookImpl) DeleteWebhook(webhookID snowflake.ID, opts ...RequestOpt) (err error) {
err = s.client.Do(DeleteWebhook.Compile(nil, webhookID), nil, nil, opts...)
return
func (s *webhookImpl) DeleteWebhook(webhookID snowflake.ID, opts ...RequestOpt) error {
return s.client.Do(DeleteWebhook.Compile(nil, webhookID), nil, nil, opts...)
}

func (s *webhookImpl) GetWebhookWithToken(webhookID snowflake.ID, webhookToken string, opts ...RequestOpt) (webhook discord.Webhook, err error) {
Expand All @@ -73,9 +72,8 @@ func (s *webhookImpl) UpdateWebhookWithToken(webhookID snowflake.ID, webhookToke
return
}

func (s *webhookImpl) DeleteWebhookWithToken(webhookID snowflake.ID, webhookToken string, opts ...RequestOpt) (err error) {
err = s.client.Do(DeleteWebhookWithToken.Compile(nil, webhookID, webhookToken), nil, nil, opts...)
return
func (s *webhookImpl) DeleteWebhookWithToken(webhookID snowflake.ID, webhookToken string, opts ...RequestOpt) error {
return s.client.Do(DeleteWebhookWithToken.Compile(nil, webhookID, webhookToken), nil, nil, opts...)
}

func (s *webhookImpl) createWebhookMessage(webhookID snowflake.ID, webhookToken string, messageCreate discord.Payload, wait bool, threadID snowflake.ID, endpoint *Endpoint, opts []RequestOpt) (message *discord.Message, err error) {
Expand Down Expand Up @@ -127,11 +125,10 @@ func (s *webhookImpl) UpdateWebhookMessage(webhookID snowflake.ID, webhookToken
return
}

func (s *webhookImpl) DeleteWebhookMessage(webhookID snowflake.ID, webhookToken string, messageID snowflake.ID, threadID snowflake.ID, opts ...RequestOpt) (err error) {
func (s *webhookImpl) DeleteWebhookMessage(webhookID snowflake.ID, webhookToken string, messageID snowflake.ID, threadID snowflake.ID, opts ...RequestOpt) error {
params := discord.QueryValues{}
if threadID != 0 {
params["thread_id"] = threadID
}
err = s.client.Do(DeleteWebhookMessage.Compile(params, webhookID, webhookToken, messageID), nil, nil, opts...)
return
return s.client.Do(DeleteWebhookMessage.Compile(params, webhookID, webhookToken, messageID), nil, nil, opts...)
}

0 comments on commit 1c388db

Please sign in to comment.