diff --git a/handler.go b/handler.go index be06818..3751c04 100644 --- a/handler.go +++ b/handler.go @@ -116,13 +116,13 @@ func (h *SlackHandler) WithGroup(name string) slog.Handler { } func (h *SlackHandler) postMessage(message *slack.WebhookMessage) error { - if h.option.WebhookURL != "" { - return slack.PostWebhook(h.option.WebhookURL, message) - } - ctx, cancel := context.WithTimeout(context.Background(), h.option.Timeout) defer cancel() + if h.option.WebhookURL != "" { + return slack.PostWebhookContext(ctx, h.option.WebhookURL, message) + } + _, _, err := slack. New(h.option.BotToken). PostMessageContext(