Mercurial > lbo > hg > goe_bot
changeset 40:7d363fef93a8
Add `unhandled` status field and fix typo in API schema
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Sat, 10 Dec 2016 16:03:43 +0100 |
parents | 3cc9ebfc1137 |
children | bc4d6a8d2e73 a9858e4be3d6 |
files | api_schema.go status.go |
diffstat | 2 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/api_schema.go Sat Dec 10 16:02:58 2016 +0100 +++ b/api_schema.go Sat Dec 10 16:03:43 2016 +0100 @@ -67,7 +67,7 @@ Chat_ID int64 `json:"chat_id"` Text string `json:"text"` Parse_Mode string `json:"parse_mode"` // either Markdown or HTML - Reply_To_message_Id int64 `json:"reply_to_message_id"` + Reply_To_Message_Id int64 `json:"reply_to_message_id"` Reply_Markup inlineKeyboardMarkup `json:"reply_markup"` // Used for replying from a webhook; usually set to "sendMessage"
--- a/status.go Sat Dec 10 16:02:58 2016 +0100 +++ b/status.go Sat Dec 10 16:03:43 2016 +0100 @@ -16,14 +16,17 @@ commands uint callbacks uint errors uint + unhandled uint apiErrors uint apiCalls uint } func (ss serverStatus) Format(ctx context.Context) string { webhookInfo, _ := getWebhookInfo(ctx) - status := fmt.Sprintf("ok=%t db=%t dbname=%s cmds=%d callbacks=%d errs=%d api-errs=%d api-calls=%d %s", - ss.ok, ss.dbConnected, ss.database, ss.commands, ss.callbacks, ss.errors, ss.apiErrors, ss.apiCalls, webhookInfo) + status := fmt.Sprintf("ok=%t db=%t dbname=%s cmds=%d callbacks=%d unhandled=%d errs=%d api-errs=%d api-calls=%d %s", + ss.ok, ss.dbConnected, ss.database, ss.commands, + ss.callbacks, ss.unhandled, ss.errors, ss.apiErrors, + ss.apiCalls, webhookInfo) return strings.Replace(status, "_", "\\_", -1) }