api

package
v0.0.0-...-e6d2835 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BlacklistKeywords = strings.Split(strings.ReplaceAll(string(keywords.Blacklist), "\r", ""), "\n")

Functions

func BotHandler

func BotHandler(w http.ResponseWriter, r *http.Request)

func ChallengeHandler

func ChallengeHandler(w http.ResponseWriter, r *http.Request)

func ContainsAny

func ContainsAny(str string, slice []string) bool

func VerifyWebappData

func VerifyWebappData(webappData string, joinData JoinReqData) (isValid bool)

Types

type JoinReqData

type JoinReqData struct {
	UserID int64 `json:"user_id"`
	ChatID int64 `json:"chat_id"`
	Time   int64 `json:"time"`
	Type   int   `json:"type"`
}

func VerifyJWT

func VerifyJWT(tokenString string) (isValid bool, data JoinReqData)

type VerifyResp

type VerifyResp struct {
	Success     bool      `json:"success"`
	ChallengeTs time.Time `json:"challenge_ts"`
	Hostname    string    `json:"hostname"`
	Credit      bool      `json:"credit"`
}

func VerifyReCaptcha

func VerifyReCaptcha(token string) (r VerifyResp)

func VerifyhCaptcha

func VerifyhCaptcha(token string) (r VerifyResp)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL