From 5b2a3804b5b8feeecfd74bc0096ae608dcd5af19 Mon Sep 17 00:00:00 2001 From: dande Date: Sat, 25 Apr 2020 16:25:20 +0300 Subject: [PATCH] dice: clean up the code --- sendable.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sendable.go b/sendable.go index 9b9597b..04cc2ef 100644 --- a/sendable.go +++ b/sendable.go @@ -353,15 +353,19 @@ func (p *Poll) Send(b *Bot, to Recipient, opt *SendOptions) (*Message, error) { return extractMessage(data) } + +// Send delivers dice through bot b to recipient func (d *Dice) Send(b *Bot, to Recipient, opt *SendOptions) (*Message, error) { params := map[string]string{ "chat_id": to.Recipient(), "emoji": string(d.Type), } embedSendOptions(params, opt) + data, err := b.Raw("sendDice", params) if err != nil { return nil, err } + return extractMessage(data) }