Newer
Older
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]"
}