ya_telegram_bot 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e50f2bee5f45b70c51c8ca36b0e926df24edf1b
4
- data.tar.gz: 496bece0ddc0a0d7bda6ba4e836ee6ce2c1050c4
3
+ metadata.gz: 33d0b778d491d225fe59fadff14f620515b9ef71
4
+ data.tar.gz: 1a840811af1f7f8c687c02e8a6d93ed0dc3a6232
5
5
  SHA512:
6
- metadata.gz: cf5cbe0c9dbd0b90349fd147865fc80997f3a107377ef8d47b0c27d44b99454bb28cafb9a2be7e17facf179f155b5384eada96f20584e7b424e710a8a3c17f31
7
- data.tar.gz: f8073223ecb540583dcc8982d609dcb96d7fd28c65ce2203418f62fd2c91fe4907d8e87966f9a4c8643733df95d819e7afa54bb3a4b450feb71a1f0f489d8189
6
+ metadata.gz: ce566672deef931074d949515b584e2cf6613266efd7bf7f4da0df9ed1cc8383a6a1e8f897b189a936afa787a44b34b4f3ce336d5b1dcfe2ed50d20e9313caa0
7
+ data.tar.gz: 7fea81894b8587ac5796a548173fee2ff2e1552f5f59b17977e765a277e1ad26c6e994da4a8683c18752ce82a0ff88022d2ba2f99f45abba3edfe80453257aff
data/README.md CHANGED
@@ -1,7 +1,30 @@
1
- # TelegramBot
1
+ # Yet Another Telegram Bot
2
2
 
3
3
  **IN DEV**
4
4
 
5
+ ## Usage
6
+
7
+ ```ruby
8
+ require 'ya_telegram_bot'
9
+
10
+ class Bot
11
+ extend YATelegramBot::Base
12
+
13
+ token YOUR_TOKEN
14
+ end
15
+
16
+ updates = Bot.updates
17
+ updates.each do |message|
18
+ chat_id = message['chat']['id']
19
+ user = message['from']['first_name']
20
+ text = "Hello, *#{user}*"
21
+
22
+ Bot.send_message chat: chat_id,
23
+ text: text,
24
+ markdown: true
25
+ end
26
+ ```
27
+
5
28
  ## Contributing
6
29
 
7
30
  Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/telegram_bot. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
@@ -2,7 +2,7 @@ require 'rest-client'
2
2
  require 'json'
3
3
  require 'time'
4
4
 
5
- module TelegramBot
5
+ module YATelegramBot
6
6
  #
7
7
  # extend your class with this module to use API.
8
8
  # Or include it if you want to use in instances
@@ -1,4 +1,4 @@
1
- module TelegramBot
1
+ module YATelegramBot
2
2
  class NoTokenSpecified; end
3
3
  class ResponseIsNotOk; end
4
4
  class NoChatSpecified; end
@@ -0,0 +1,3 @@
1
+ module YATelegramBot
2
+ VERSION = '0.1.1'.freeze
3
+ end
@@ -0,0 +1,8 @@
1
+ require_relative 'ya_telegram_bot/version'
2
+ require_relative 'ya_telegram_bot/base'
3
+
4
+ #
5
+ # root namespace
6
+ #
7
+ module YATelegramBot
8
+ end
@@ -1,15 +1,16 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'telegram_bot/version'
4
+ require 'ya_telegram_bot/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'ya_telegram_bot'
8
- spec.version = TelegramBot::VERSION
8
+ spec.version = YATelegramBot::VERSION
9
9
  spec.authors = ['Dmitriy Non']
10
10
  spec.email = ['non.dmitriy@gmail.com']
11
11
 
12
- spec.summary = 'module for using telegram bots'
12
+ spec.summary = 'Yet Another Telegram Bot'
13
+ spec.description = 'Module for using Telegram Bot API'
13
14
  spec.homepage = ''
14
15
  spec.license = 'MIT'
15
16
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ya_telegram_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitriy Non
@@ -80,7 +80,7 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.8'
83
- description:
83
+ description: Module for using Telegram Bot API
84
84
  email:
85
85
  - non.dmitriy@gmail.com
86
86
  executables: []
@@ -96,11 +96,11 @@ files:
96
96
  - LICENSE.txt
97
97
  - README.md
98
98
  - Rakefile
99
- - lib/telegram_bot.rb
100
- - lib/telegram_bot/base.rb
101
- - lib/telegram_bot/exceptions.rb
102
- - lib/telegram_bot/version.rb
103
- - telegram_bot.gemspec
99
+ - lib/ya_telegram_bot.rb
100
+ - lib/ya_telegram_bot/base.rb
101
+ - lib/ya_telegram_bot/exceptions.rb
102
+ - lib/ya_telegram_bot/version.rb
103
+ - ya_telegram_bot.gemspec
104
104
  homepage: ''
105
105
  licenses:
106
106
  - MIT
@@ -124,6 +124,6 @@ rubyforge_project:
124
124
  rubygems_version: 2.4.6
125
125
  signing_key:
126
126
  specification_version: 4
127
- summary: module for using telegram bots
127
+ summary: Yet Another Telegram Bot
128
128
  test_files: []
129
129
  has_rdoc:
@@ -1,3 +0,0 @@
1
- module TelegramBot
2
- VERSION = '0.1.0'.freeze
3
- end
data/lib/telegram_bot.rb DELETED
@@ -1,8 +0,0 @@
1
- require_relative 'telegram_bot/version'
2
- require_relative 'telegram_bot/base'
3
-
4
- #
5
- # root namespace
6
- #
7
- module TelegramBot
8
- end