func NewTelegramHookWithClient(appName, authToken, targetID, group string, client *http.Client, config ...Config) (*TelegramHook, error) {
	apiEndpoint := fmt.Sprintf(
		"https://api.telegram.org/bot%s",
		authToken,
	)
	h := TelegramHook{
		AppName:     appName,
		c:           client,
		authToken:   authToken,
		targetID:    targetID,
		group:       group,
		apiEndpoint: apiEndpoint,
		async:       false,
	}

	for _, c := range config {
		c(&h)
	}

	// Verify the API token is valid and correct before continuing
	err := h.verifyToken()
	if err != nil {
		return nil, err
	}

	return &h, nil
}
// NewTelegramHook creates a new instance of a hook targeting the
// Telegram API with custom http.Client.
NewTelegramHook creates a new instance of a hook targeting the
Telegram API with custom http.Client.
// NewTelegramHook creates a new instance of a hook targeting the // Telegram API with custom http . Client .
func NewTelegramHookWithClient(appName, authToken, targetID, group string, client *http.Client, config ...Config) (*TelegramHook, error) {
	apiEndpoint := fmt.Sprintf(
		"https://api.telegram.org/bot%s",
		authToken,
	)
	h := TelegramHook{
		AppName:     appName,
		c:           client,
		authToken:   authToken,
		targetID:    targetID,
		group:       group,
		apiEndpoint: apiEndpoint,
		async:       false,
	}
	for _, c := range config {
		c(&h)
	}
	err := h.verifyToken()
	if err != nil {
		return nil, err
	}
	return &h, nil
}
func NewTelegramHookWithClient ( appName , authToken , targetID , group string , client * http . Client , config ... Config ) ( * TelegramHook , error ) { apiEndpoint := fmt . Sprintf ( " " , authToken , ) h := TelegramHook { AppName : appName , c : client , authToken : authToken , targetID : targetID , group : group , apiEndpoint : apiEndpoint , async : false , } for _ , c := range config { c ( & h ) } err := h . verifyToken ( ) if err != nil { return nil , err } return & h , nil }
NewTelegramHook creates a new instance of a hook targeting the
Telegram API with custom http.Client.
NewTelegramHook creates a new instance of a hook targeting the Telegram API with custom http . Client .
// Verify the API token is valid and correct before continuing