diff --git a/bot/handler/coin.go b/bot/handler/coin.go index 37322f3..5ed45dc 100644 --- a/bot/handler/coin.go +++ b/bot/handler/coin.go @@ -21,9 +21,7 @@ func (c *Coin) Flip() bool { } func NewCoinHandler(s string) *CoinHandler { - h := new(CoinHandler) - h.Name = s - return h + return &CoinHandler{Name: s} } func (h *CoinHandler) SetConfig(config bot.Config) { diff --git a/bot/handler/dice.go b/bot/handler/dice.go index 59ce739..cfe7ee6 100644 --- a/bot/handler/dice.go +++ b/bot/handler/dice.go @@ -85,9 +85,7 @@ func (r *Roll) RollDice() { } func NewRollHandler(s string) *RollHandler { - h := new(RollHandler) - h.Name = s - return h + return &RollHandler{Name: s} } func (h *RollHandler) SetConfig(config bot.Config) { diff --git a/bot/handler/ping.go b/bot/handler/ping.go index a34e4d1..106d3fc 100644 --- a/bot/handler/ping.go +++ b/bot/handler/ping.go @@ -15,9 +15,7 @@ type ( ) func NewPingHandler(s string) *PingHandler { - h := new(PingHandler) - h.Name = s - return h + return &PingHandler{Name: s} } func (h *PingHandler) SetConfig(config bot.Config) { diff --git a/bot/handler/roulette.go b/bot/handler/roulette.go index 3edc094..cdfafde 100644 --- a/bot/handler/roulette.go +++ b/bot/handler/roulette.go @@ -75,9 +75,7 @@ func (g *Gun) IsEmpty() bool { } func NewRouletteHandler(s string) *RouletteHandler { - h := new(RouletteHandler) - h.Name = s - return h + return &RouletteHandler{Name: s} } func (h *RouletteHandler) SetConfig(config bot.Config) { diff --git a/bot/handler/time.go b/bot/handler/time.go index 9f59f76..3b3fe85 100644 --- a/bot/handler/time.go +++ b/bot/handler/time.go @@ -18,9 +18,7 @@ type ( ) func NewTimeHandler(s string) *TimeHandler { - h := new(TimeHandler) - h.Name = s - return h + return &TimeHandler{Name: s} } func (h *TimeHandler) SetConfig(config bot.Config) { diff --git a/bot/handler/version.go b/bot/handler/version.go index 8964c55..72b1f06 100644 --- a/bot/handler/version.go +++ b/bot/handler/version.go @@ -21,9 +21,7 @@ type ( ) func NewVersionHandler(s string) *VersionHandler { - h := new(VersionHandler) - h.Name = s - return h + return &VersionHandler{Name: s} } func (h *VersionHandler) SetConfig(config bot.Config) { diff --git a/bot/handler/weather.go b/bot/handler/weather.go index a946ec1..2b5b510 100644 --- a/bot/handler/weather.go +++ b/bot/handler/weather.go @@ -17,9 +17,7 @@ type WeatherHandler struct { } func NewWeatherHandler(s string) *WeatherHandler { - h := new(WeatherHandler) - h.Name = s - return h + return &WeatherHandler{Name: s} } func (h *WeatherHandler) SetConfig(config bot.Config) {