feat: add sendDice configs
Add sendDice config to use in Send method as a Chattable interface. Add NewDice and NewDiceWithEmoji helpers Add tests https://core.telegram.org/bots/api#senddice
This commit is contained in:
parent
2476225ecc
commit
f11e1caecf
6 changed files with 103 additions and 5 deletions
28
bot_test.go
28
bot_test.go
|
@ -8,7 +8,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/go-telegram-bot-api/telegram-bot-api"
|
||||
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -402,6 +402,32 @@ func TestSendWithExistingStickerAndKeyboardHide(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestSendWithDice(t *testing.T) {
|
||||
bot, _ := getBot(t)
|
||||
|
||||
msg := tgbotapi.NewDice(ChatID)
|
||||
_, err := bot.Send(msg)
|
||||
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestSendWithDiceWithEmoji(t *testing.T) {
|
||||
bot, _ := getBot(t)
|
||||
|
||||
msg := tgbotapi.NewDiceWithEmoji(ChatID, "🏀")
|
||||
_, err := bot.Send(msg)
|
||||
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestGetFile(t *testing.T) {
|
||||
bot, _ := getBot(t)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue