Documentation ¶
Index ¶
Constants ¶
const BLANK_PARENT = -1
const NONEXISTENT_PARENT = -2
const NONEXISTENT_POST = -1
const UNCHANGED_PARENT = 0
Variables ¶
This section is empty.
Functions ¶
func GetParentPostFromText ¶
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 ¶
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 ¶
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.