dice: clean up the code

pull/269/head
dande 4 years ago
parent 9268c6dff7
commit 5b2a3804b5

@ -353,15 +353,19 @@ func (p *Poll) Send(b *Bot, to Recipient, opt *SendOptions) (*Message, error) {
return extractMessage(data) return extractMessage(data)
} }
// Send delivers dice through bot b to recipient
func (d *Dice) Send(b *Bot, to Recipient, opt *SendOptions) (*Message, error) { func (d *Dice) Send(b *Bot, to Recipient, opt *SendOptions) (*Message, error) {
params := map[string]string{ params := map[string]string{
"chat_id": to.Recipient(), "chat_id": to.Recipient(),
"emoji": string(d.Type), "emoji": string(d.Type),
} }
embedSendOptions(params, opt) embedSendOptions(params, opt)
data, err := b.Raw("sendDice", params) data, err := b.Raw("sendDice", params)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return extractMessage(data) return extractMessage(data)
} }

Loading…
Cancel
Save