Sha256: b60d1fa4e78f6a5d40c5da33c5087b5e211021bad10ce593bdcd9fb35c9c97a3
Contents?: true
Size: 558 Bytes
Versions: 1
Compression:
Stored size: 558 Bytes
Contents
# frozen_string_literal: true require "faraday" require "faraday/net_http" module TeBot class Wire CONN = Faraday.new( url: "https://api.telegram.org/", headers: {"Content-Type" => "application/json"} ) def url(path) "/bot#{@access_token}/#{path}" end def initialize(access_token) @access_token = access_token end def send_message(chat_id, message) CONN.post(url("sendMessage")) do |req| req.params["chat_id"] = chat_id req.params["text"] = message end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
te_bot-0.1.0 | lib/te_bot/wire.rb |