Skip to content

Commit

Permalink
docs(discord) : Add return webhook method doc
Browse files Browse the repository at this point in the history
  • Loading branch information
seipan committed Nov 25, 2023
1 parent f554744 commit 7b4798a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,34 +46,43 @@ type Discord struct {
fatalWebhook string
}

// NewDiscord returns a structure Discord that manages the webhooks of Discord.
func NewDiscord(webhook string) *Discord {
return &Discord{webhook: webhook}
}

// These return each webhook of Discord.
// If the webhook url for any level is not set, the webhook url set by SetWebhook() will be used.
func (d *Discord) Webhook() string {
return d.webhook
}

// It returns the webhook for the debug level.
func (d *Discord) DebugWebhook() string {
return d.debugWebhook
}

// It returns the webhook for the info level.
func (d *Discord) InfoWebhook() string {
return d.infoWebhook
}

// It returns the webhook for the warn level.
func (d *Discord) WarnWebhook() string {
return d.warnWebhook
}

// It returns the webhook for the error level.
func (d *Discord) ErrorWebhook() string {
return d.errorWebhook
}

// It returns the webhook for the panic level.
func (d *Discord) PanicWebhook() string {
return d.panicWebhook
}

// It returns the webhook for the fatal level.
func (d *Discord) FatalWebhook() string {
return d.fatalWebhook
}
Expand Down

0 comments on commit 7b4798a

Please sign in to comment.