Skip to content
Snippets Groups Projects
endpoint.go 320 B
Newer Older
Diez37's avatar
Diez37 committed
package telegram

import (
	"fmt"
	"gopkg.in/telebot.v3"
)

func extractEndpointName(endpoint interface{}) string {
	switch endpoint := endpoint.(type) {
	case string:
		return fmt.Sprintf("[%s]", endpoint)
	case *telebot.Btn:
		return fmt.Sprintf("[button:%s]", endpoint.Unique)
	}

	return "[endpoint type unknown]"
}