apiextra

package
v0.0.0-...-b0fc717 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const BLANK_PARENT = -1
View Source
const NONEXISTENT_PARENT = -2
View Source
const NONEXISTENT_POST = -1
View Source
const UNCHANGED_PARENT = 0

Variables

This section is empty.

Functions

func GetParentPostFromText

func GetParentPostFromText(text string) int

attempts to recover a post id from a string, for use as a parent post to another post. relies on GetPostIDFromText for this. also accepts the special value "none" to reset the parent's post to nothing, or "original" to leave the parent unchanged. returns a positive integer post id, BLANK_PARENT to indicate "none", or UNCHANGED_PARENT to indicate "original". if no post id could be discovered, returns NONEXISTENT_PARENT.

func GetPostIDFromMessage

func GetPostIDFromMessage(msg *data.TMessage) int

attempts to recover a post id from a telegram message. first, tries to match any URL in a url text entity. second, tries GetPostIDFromText on the full message plaintext. returns NONEXISTENT_POST if no matches were found.

func GetPostIDFromText

func GetPostIDFromText(text string) int

attempts to recover a post id from the specified text string. first, searches for a matching post url and returns its post number if present. second, searches for and returns a non-negative number not part of another word. returns NONEXISTENT_POST if no matches were found.

func Init

func Init(s settings) error

Types

type Ratings

type Ratings struct {
	Safe, Questionable, Explicit bool
}

func RatingsFromString

func RatingsFromString(tags string) Ratings

func (Ratings) And

func (this Ratings) And(other Ratings) Ratings

func (Ratings) RatingTag

func (this Ratings) RatingTag() string

Jump to

Keyboard shortcuts

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