Module: Telegram::CoreApi
- Included in:
- DeleteApis, GetApis, NonStandard, OtherApis, SendApis, SetApis
- Defined in:
- lib/core_api.rb
Constant Summary collapse
- @@base_uri =
%q{https://api.telegram.org/bot}- @@file_uri =
to download files
%q{https://api.telegram.org/file/bot}
Instance Method Summary collapse
Instance Method Details
#http_get(method, params = {}) ⇒ Object
32 33 34 35 |
# File 'lib/core_api.rb', line 32 def http_get(method, params = {}) body = Faraday.post(@@base_uri + @token + '/' + method, params).body JSON.parse(body) end |
#http_post(method, params = {}) ⇒ Object
37 38 39 40 |
# File 'lib/core_api.rb', line 37 def http_post(method, params = {}) body = Faraday.post(@@base_uri + @token + '/' + method, params).body JSON.parse(body) end |