all repos — telegram-bot-api @ 6c84cd1fbbb95d6d1286150cd682bb7b8c0cb2be

Golang bindings for the Telegram Bot API

Replace bad file type error with constant
Syfaro syfaro@foxpaw.in
Sun, 03 Jan 2016 22:49:58 -0600
commit

6c84cd1fbbb95d6d1286150cd682bb7b8c0cb2be

parent

99262cf76c9614211a15f726b0ce6a435a6f1286

2 files changed, 7 insertions(+), 1 deletions(-)

jump to
M bot.gobot.go

@@ -146,7 +146,7 @@ buf := bytes.NewBuffer(data)

ms.WriteReader(fieldname, f.Name, int64(len(data)), buf) default: - return APIResponse{}, errors.New("bad file type") + return APIResponse{}, errors.New(ErrBadFileType) } method := fmt.Sprintf(APIEndpoint, bot.Token, endpoint)
M configs.goconfigs.go

@@ -39,6 +39,12 @@ const (

ModeMarkdown = "Markdown" ) +// Library errors +const ( + // ErrBadFileType happens when you pass an unknown type + ErrBadFileType = "bad file type" +) + // Chattable is any config type that can be sent. type Chattable interface { values() (url.Values, error)