Documentation ¶
Index ¶
- Constants
- func EditPromptID() data.DialogID
- func GetNameOfState(state string) string
- func PostPromptID() data.DialogID
- type EditFormatter
- type EditFormatterBase
- type EditPrompt
- func (this *EditPrompt) ApplyReset(state string)
- func (this *EditPrompt) CommitEdit(tx storage.DBLike, user, api_key string, ctx *gogram.MessageCtx) (*types.TPostInfo, error)
- func (this *EditPrompt) Finalize(tx storage.DBLike, bot *gogram.TelegramBot, ctx *gogram.MessageCtx, ...) *gogram.MessageCtx
- func (this *EditPrompt) HandleCallback(ctx *gogram.CallbackCtx)
- func (this *EditPrompt) HandleFreeform(ctx *gogram.MessageCtx)
- func (this *EditPrompt) ID() data.DialogID
- func (this *EditPrompt) IsComplete() error
- func (this *EditPrompt) IsNoop() bool
- func (this *EditPrompt) JSON() (string, error)
- func (this *EditPrompt) ParseArgs(ctx *gogram.MessageCtx) (bool, error)
- func (this *EditPrompt) PostStatus(b *bytes.Buffer)
- func (this *EditPrompt) Prompt(tx storage.DBLike, bot *gogram.TelegramBot, ctx *gogram.MessageCtx, ...) *gogram.MessageCtx
- func (this *EditPrompt) ResetState()
- func (this *EditPrompt) SeeSource(source string)
- func (this *EditPrompt) SourceButton(n int, pick bool)
- func (this *EditPrompt) SourceStringLiteral(source string, pick bool)
- func (this *EditPrompt) SourceStringPrefixed(source string)
- type PostFile
- type PostFormatter
- type PostPrompt
- func (this *PostPrompt) ApplyReset(state string)
- func (this *PostPrompt) CommitPost(user, api_key string, ctx *gogram.MessageCtx) (*api.UploadCallResult, error)
- func (this *PostPrompt) Finalize(tx storage.DBLike, bot *gogram.TelegramBot, ctx *gogram.MessageCtx, ...) *gogram.MessageCtx
- func (this *PostPrompt) HandleCallback(ctx *gogram.CallbackCtx)
- func (this *PostPrompt) HandleFreeform(ctx *gogram.MessageCtx)
- func (this *PostPrompt) ID() data.DialogID
- func (this *PostPrompt) IsComplete() error
- func (this *PostPrompt) JSON() (string, error)
- func (this *PostPrompt) ParseArgs(ctx *gogram.MessageCtx) (bool, error)
- func (this *PostPrompt) PostStatus(b *bytes.Buffer)
- func (this *PostPrompt) Prompt(tx storage.DBLike, bot *gogram.TelegramBot, ctx *gogram.MessageCtx, ...) *gogram.MessageCtx
- func (this *PostPrompt) ResetState()
- func (this *PostPrompt) SeeSource(source string)
- func (this *PostPrompt) SourceButton(n int, pick bool)
- func (this *PostPrompt) SourceStringLiteral(source string, pick bool)
- func (this *PostPrompt) SourceStringPrefixed(source string)
- func (this *PostPrompt) TestRating() types.PostRating
Constants ¶
View Source
const DISCARDED string = "discarded"
View Source
const EDIT_PROMPT_ID data.DialogID = "editprompt"
View Source
const PARENT_NONE int = -1
special parent constants
View Source
const PARENT_RESET int = 0
View Source
const PF_FROM_TELEGRAM int = 1
View Source
const PF_FROM_URL int = 2
View Source
const PF_UNSET int = 0
View Source
const POST_PROMPT_ID data.DialogID = "postprompt"
View Source
const SAVED string = "saved"
View Source
const WAIT_ALL string = "wait_all"
View Source
const WAIT_DESC string = "wait_desc"
View Source
const WAIT_FILE string = "wait_file"
View Source
const WAIT_MODE string = ""
state constants
View Source
const WAIT_PARENT string = "wait_parent"
View Source
const WAIT_RATING string = "wait_rating"
View Source
const WAIT_REASON string = "wait_reason"
View Source
const WAIT_SOURCE string = "wait_source"
View Source
const WAIT_TAGS string = "wait_tags"
Variables ¶
This section is empty.
Functions ¶
func EditPromptID ¶
func GetNameOfState ¶
func PostPromptID ¶
Types ¶
type EditFormatter ¶
type EditFormatter struct { EditFormatterBase Error error }
func NewEditFormatter ¶
func NewEditFormatter(request_reply bool, err error) EditFormatter
func (EditFormatter) GenerateMarkup ¶
func (this EditFormatter) GenerateMarkup(prompt *EditPrompt) interface{}
func (EditFormatter) GenerateMessage ¶
func (this EditFormatter) GenerateMessage(prompt *EditPrompt) string
func (EditFormatter) Warnings ¶
func (this EditFormatter) Warnings(b *bytes.Buffer, prompt *EditPrompt)
type EditFormatterBase ¶
type EditFormatterBase struct {
// contains filtered or unexported fields
}
func (EditFormatterBase) WarningsBase ¶
func (this EditFormatterBase) WarningsBase(b *bytes.Buffer, warnings []string)
type EditPrompt ¶
type EditPrompt struct { dialog.TelegramDialogPost `json:"-"` PostId int `json:"post_id"` Status string `json:"status"` State string `json:"state"` // stuff to generate the post info TagChanges tags.TagDiff `json:"tag_changes"` SourceChanges tags.StringDiff `json:"source_changes"` // not actually tags, but you can treat them the same. OrigSources map[string]int `json:"sources_live"` SeenSources map[string]int `json:"source_seen"` SeenSourcesReverse []string `json:"source_seen_rev"` Parent int `json:"parent"` Rating types.PostRating `json:"rating"` Description string `json:"description"` File PostFile `json:"file"` Reason string `json:"reason"` }
func LoadEditPrompt ¶
func (*EditPrompt) ApplyReset ¶
func (this *EditPrompt) ApplyReset(state string)
func (*EditPrompt) CommitEdit ¶
func (this *EditPrompt) CommitEdit(tx storage.DBLike, user, api_key string, ctx *gogram.MessageCtx) (*types.TPostInfo, error)
func (*EditPrompt) Finalize ¶
func (this *EditPrompt) Finalize(tx storage.DBLike, bot *gogram.TelegramBot, ctx *gogram.MessageCtx, frmt EditFormatter) *gogram.MessageCtx
func (*EditPrompt) HandleCallback ¶
func (this *EditPrompt) HandleCallback(ctx *gogram.CallbackCtx)
func (*EditPrompt) HandleFreeform ¶
func (this *EditPrompt) HandleFreeform(ctx *gogram.MessageCtx)
func (*EditPrompt) ID ¶
func (this *EditPrompt) ID() data.DialogID
func (*EditPrompt) IsComplete ¶
func (this *EditPrompt) IsComplete() error
func (*EditPrompt) IsNoop ¶
func (this *EditPrompt) IsNoop() bool
func (*EditPrompt) JSON ¶
func (this *EditPrompt) JSON() (string, error)
func (*EditPrompt) ParseArgs ¶
func (this *EditPrompt) ParseArgs(ctx *gogram.MessageCtx) (bool, error)
func (*EditPrompt) PostStatus ¶
func (this *EditPrompt) PostStatus(b *bytes.Buffer)
func (*EditPrompt) Prompt ¶
func (this *EditPrompt) Prompt(tx storage.DBLike, bot *gogram.TelegramBot, ctx *gogram.MessageCtx, frmt EditFormatter) *gogram.MessageCtx
func (*EditPrompt) ResetState ¶
func (this *EditPrompt) ResetState()
func (*EditPrompt) SeeSource ¶
func (this *EditPrompt) SeeSource(source string)
func (*EditPrompt) SourceButton ¶
func (this *EditPrompt) SourceButton(n int, pick bool)
func (*EditPrompt) SourceStringLiteral ¶
func (this *EditPrompt) SourceStringLiteral(source string, pick bool)
func (*EditPrompt) SourceStringPrefixed ¶
func (this *EditPrompt) SourceStringPrefixed(source string)
type PostFile ¶
type PostFile struct { Mode int `json:"pf_mode"` FileId data.FileID `json:"pf_tfid"` FileName string `json:"pf_tfname"` Url string `json:"pf_furl"` SizeBytes int64 `json:"pf_size"` }
func (*PostFile) SetTelegramFile ¶
type PostFormatter ¶
type PostFormatter struct { EditFormatterBase Result *api.UploadCallResult }
func NewPostFormatter ¶
func NewPostFormatter(request_reply bool, result *api.UploadCallResult) PostFormatter
func (PostFormatter) GenerateMarkup ¶
func (this PostFormatter) GenerateMarkup(prompt *PostPrompt) interface{}
func (PostFormatter) GenerateMessage ¶
func (this PostFormatter) GenerateMessage(prompt *PostPrompt) string
func (PostFormatter) Warnings ¶
func (this PostFormatter) Warnings(b *bytes.Buffer, prompt *PostPrompt)
type PostPrompt ¶
type PostPrompt struct { dialog.TelegramDialogPost `json:"-"` PostId int `json:"post_id"` Status string `json:"status"` State string `json:"state"` // stuff to generate the post info TagWizard wizard.TagWizard `json:"tagwiz"` Sources tags.StringSet `json:"sources"` // not actually tags, but you can treat them the same. SeenSources map[string]int `json:"source_seen"` SeenSourcesReverse []string `json:"source_seen_rev"` Parent int `json:"parent"` Rating types.PostRating `json:"rating"` Description string `json:"description"` File PostFile `json:"file"` }
func LoadPostPrompt ¶
func (*PostPrompt) ApplyReset ¶
func (this *PostPrompt) ApplyReset(state string)
func (*PostPrompt) CommitPost ¶
func (this *PostPrompt) CommitPost(user, api_key string, ctx *gogram.MessageCtx) (*api.UploadCallResult, error)
func (*PostPrompt) Finalize ¶
func (this *PostPrompt) Finalize(tx storage.DBLike, bot *gogram.TelegramBot, ctx *gogram.MessageCtx, frmt PostFormatter) *gogram.MessageCtx
func (*PostPrompt) HandleCallback ¶
func (this *PostPrompt) HandleCallback(ctx *gogram.CallbackCtx)
func (*PostPrompt) HandleFreeform ¶
func (this *PostPrompt) HandleFreeform(ctx *gogram.MessageCtx)
func (*PostPrompt) ID ¶
func (this *PostPrompt) ID() data.DialogID
func (*PostPrompt) IsComplete ¶
func (this *PostPrompt) IsComplete() error
func (*PostPrompt) JSON ¶
func (this *PostPrompt) JSON() (string, error)
func (*PostPrompt) ParseArgs ¶
func (this *PostPrompt) ParseArgs(ctx *gogram.MessageCtx) (bool, error)
func (*PostPrompt) PostStatus ¶
func (this *PostPrompt) PostStatus(b *bytes.Buffer)
func (*PostPrompt) Prompt ¶
func (this *PostPrompt) Prompt(tx storage.DBLike, bot *gogram.TelegramBot, ctx *gogram.MessageCtx, frmt PostFormatter) *gogram.MessageCtx
func (*PostPrompt) ResetState ¶
func (this *PostPrompt) ResetState()
func (*PostPrompt) SeeSource ¶
func (this *PostPrompt) SeeSource(source string)
func (*PostPrompt) SourceButton ¶
func (this *PostPrompt) SourceButton(n int, pick bool)
func (*PostPrompt) SourceStringLiteral ¶
func (this *PostPrompt) SourceStringLiteral(source string, pick bool)
func (*PostPrompt) SourceStringPrefixed ¶
func (this *PostPrompt) SourceStringPrefixed(source string)
func (*PostPrompt) TestRating ¶
func (this *PostPrompt) TestRating() types.PostRating
Click to show internal directories.
Click to hide internal directories.