Browse Source

Feat(telegram): Update help & show to include raw & body

master
Samuel Pua 3 years ago
parent
commit
2a7cad131e
  1. 4
      backend/internal/webhookeverything/routegencontrollertelegram.go

4
backend/internal/webhookeverything/routegencontrollertelegram.go

@ -56,7 +56,7 @@ func (env *Env) registerWebhookBody(shortCode string, text string) (bool, *strin
func (env *Env) displayHelp(shortCode string, text string) (bool, *string) { func (env *Env) displayHelp(shortCode string, text string) (bool, *string) {
commandSplitted := telegrampackage.ParseTelegramBotCommand(text) commandSplitted := telegrampackage.ParseTelegramBotCommand(text)
if len(commandSplitted) > 0 && commandSplitted[0] == "/help" { if len(commandSplitted) > 0 && commandSplitted[0] == "/help" {
responseText := "/register -> Register for a chat ID\n/register_webhook -> Register for a web hook\n/show -> Show existing webhooks"
responseText := "/register -> Register for a chat ID\n/register_webhook_raw -> Register for a web hook for raw requests\n/register_webhook_body -> Register for a web hook for requests body\n/show -> Show existing webhooks"
return true, &responseText return true, &responseText
} }
return false, nil return false, nil
@ -74,7 +74,7 @@ func (env *Env) showRoutes(shortCode string, text string) (bool, *string) {
baseURL.Path = path.Join(baseURL.Path, "routes") baseURL.Path = path.Join(baseURL.Path, "routes")
baseURL.Path = path.Join(baseURL.Path, curr.WebhookID) baseURL.Path = path.Join(baseURL.Path, curr.WebhookID)
webhookURL := baseURL.String() webhookURL := baseURL.String()
responseText += fmt.Sprintf("%s\n", webhookURL)
responseText += fmt.Sprintf("%s (%s)\n", webhookURL, curr.WebhookType)
} }
return true, &responseText return true, &responseText
} }

Loading…
Cancel
Save