|
|
@ -48,11 +48,15 @@ type Context interface {
|
|
|
|
// Returns nil if chat is not presented.
|
|
|
|
// Returns nil if chat is not presented.
|
|
|
|
Chat() *Chat
|
|
|
|
Chat() *Chat
|
|
|
|
|
|
|
|
|
|
|
|
// Text returns the current text, depending on the context type.
|
|
|
|
// Text returns the message text, depending on the context type.
|
|
|
|
// If the context contains payment, returns its payload.
|
|
|
|
|
|
|
|
// In the case when no related data presented, returns an empty string.
|
|
|
|
// In the case when no related data presented, returns an empty string.
|
|
|
|
Text() string
|
|
|
|
Text() string
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Data returns the current data, depending on the context type.
|
|
|
|
|
|
|
|
// If the context contains payment, returns its payload.
|
|
|
|
|
|
|
|
// In the case when no related data presented, returns an empty string.
|
|
|
|
|
|
|
|
Data() string
|
|
|
|
|
|
|
|
|
|
|
|
// Args returns a raw slice of command or callback arguments as strings.
|
|
|
|
// Args returns a raw slice of command or callback arguments as strings.
|
|
|
|
// The message arguments split by space, while the callback's ones by a "|" symbol.
|
|
|
|
// The message arguments split by space, while the callback's ones by a "|" symbol.
|
|
|
|
Args() []string
|
|
|
|
Args() []string
|
|
|
@ -208,6 +212,17 @@ func (c *nativeContext) Text() string {
|
|
|
|
return c.callback.Message.Text
|
|
|
|
return c.callback.Message.Text
|
|
|
|
case c.query != nil:
|
|
|
|
case c.query != nil:
|
|
|
|
return c.query.Text
|
|
|
|
return c.query.Text
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
return ""
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (c *nativeContext) Data() string {
|
|
|
|
|
|
|
|
switch {
|
|
|
|
|
|
|
|
case c.callback != nil:
|
|
|
|
|
|
|
|
return c.callback.Data
|
|
|
|
|
|
|
|
case c.query != nil:
|
|
|
|
|
|
|
|
return c.query.Text
|
|
|
|
case c.chosenInlineResult != nil:
|
|
|
|
case c.chosenInlineResult != nil:
|
|
|
|
return c.chosenInlineResult.Query
|
|
|
|
return c.chosenInlineResult.Query
|
|
|
|
case c.shippingQuery != nil:
|
|
|
|
case c.shippingQuery != nil:
|
|
|
|