1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-10-01 06:48:51 +00:00

Webhook: Shorter constructor function names

This commit is contained in:
diamondburned 2020-12-16 13:22:26 -08:00
parent 868825da7d
commit 1483dd71d8

View file

@ -26,14 +26,14 @@ type Client struct {
Token string Token string
} }
// NewClient creates a new Client using the passed token and id. // New creates a new Client using the passed token and id.
func NewClient(id discord.WebhookID, token string) *Client { func New(id discord.WebhookID, token string) *Client {
return NewCustomClient(id, token, httputil.NewClient()) return NewCustom(id, token, httputil.NewClient())
} }
// NewCustomClient creates a new Client creates a new Client using the passed // NewCustom creates a new Client creates a new Client using the passed token
// token and id and makes API calls using the passed httputil.Client // and ID and makes API calls using the passed httputil.Client
func NewCustomClient(id discord.WebhookID, token string, c *httputil.Client) *Client { func NewCustom(id discord.WebhookID, token string, c *httputil.Client) *Client {
return &Client{ return &Client{
Client: c, Client: c,
ID: id, ID: id,