Class: InlineQuery

Inherits:
Object
  • Object
show all
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

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

#fromObject

Sender. User object



21
22
23
# File 'lib/objects/inline_query.rb', line 21

def from
  User.new(@query.from)
end

#idObject

Unique identifier for this query



15
16
17
# File 'lib/objects/inline_query.rb', line 15

def id
  @query.id
end

#locationObject

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

#offsetObject

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

#queryObject

Text of the query (up to 256 characters)



34
35
36
# File 'lib/objects/inline_query.rb', line 34

def query
  @query.query
end