Class: InlineQuery
- Inherits:
-
Object
- Object
- InlineQuery
- Defined in:
- lib/objects/inline_query.rb
Overview
This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
Instance Method Summary collapse
-
#from ⇒ Object
Sender.
-
#id ⇒ Object
Unique identifier for this query.
-
#initialize(query) ⇒ InlineQuery
constructor
:nodoc:.
-
#location ⇒ Object
Optional
. -
#offset ⇒ Object
Offset of the results to be returned, can be controlled by the bot.
-
#query ⇒ Object
Text of the query (up to 256 characters).
Constructor Details
#initialize(query) ⇒ InlineQuery
:nodoc:
10 11 12 |
# File 'lib/objects/inline_query.rb', line 10 def initialize(query) # :nodoc: @query = query end |
Instance Method Details
#from ⇒ Object
Sender. User object
21 22 23 |
# File 'lib/objects/inline_query.rb', line 21 def from User.new(@query.from) end |
#id ⇒ Object
Unique identifier for this query
15 16 17 |
# File 'lib/objects/inline_query.rb', line 15 def id @query.id end |
#location ⇒ Object
Optional
. Sender location, only for bots that request user location,
26 27 28 29 30 31 |
# File 'lib/objects/inline_query.rb', line 26 def location lcation = @query.location return Location.new(lcation) if lcation false end |
#offset ⇒ Object
Offset of the results to be returned, can be controlled by the bot.
39 40 41 |
# File 'lib/objects/inline_query.rb', line 39 def offset @query.offset end |
#query ⇒ Object
Text of the query (up to 256 characters)
34 35 36 |
# File 'lib/objects/inline_query.rb', line 34 def query @query.query end |