Skip to content

Commit

Permalink
Message should be passed by-value.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Byrd committed Aug 19, 2017
1 parent 7acb52c commit f7a78ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Default string = ""

type Context struct {
Bot *Bot
Message *Message
Message Message
}

type Handler func(Context)
Expand All @@ -14,7 +14,7 @@ func (b *Bot) Handle(prefix string, handler Handler) {
b.tree.Insert(prefix, handler)
}

func (b *Bot) Serve(msg *Message) {
func (b *Bot) Serve(msg Message) {
request := msg.Text

_, value, _ := b.tree.LongestPrefix(request)
Expand Down

0 comments on commit f7a78ef

Please sign in to comment.