lita-telegram-plus 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: 089420814a21b4c248fba9c083775b3b92fb20da
4
- data.tar.gz: 827b3066844f17a9913475fc7fcc0fcfffda5d5b
3
+ metadata.gz: 7a6f3680456482d100037784fba1409e30d9407c
4
+ data.tar.gz: 08400c243d5efcc0dd88720e11782378ccd75dac
5
5
  SHA512:
6
- metadata.gz: 2f443cdd886a82317c44e22d759f948a7ff6532f3fcfc9f076adda39cf5f591ec9850cb383f1ee51eb9f34f53f8e2ef4be8491622012478fa88c55f4500784d8
7
- data.tar.gz: e79c08b3ad37df8b62ae131084487b43ef9985a344188af1302ba56d284a5a7b776049bb47c4518c474f52570d40a7abfffced42d366ca428e3f50680a228089
6
+ metadata.gz: 29f457fd036e2d138d2e16906c1e88ccad0ed65c32cc71d8edce7a2e2548da891752430c465ffe30a1d0b8acbdf68b60af3652afc59285c7b5a0ccafba3a03c3
7
+ data.tar.gz: 4d9a5f6048c94f88d39d8a70de9ae5da206f9bcdf02180cf7dfdbdcd712696f1cfb924ba740220aea5625f24bb02257b2ded9ab40bad5410df1a2a169b1bfede
@@ -0,0 +1,8 @@
1
+ # 0.1.1
2
+
3
+ - Set a user's first_name as Lita name
4
+ - If the user's name was == id, set it as first_name now
5
+
6
+ # 0.1.0
7
+
8
+ - First functional release
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # lita-telegram-plus
2
2
 
3
- TODO: Add a description of the plugin.
3
+ A simple [Lita.io](https://lita.io) adapter for Telegram.
4
+
5
+ Other Lita Telegram adapters didn't handle Telegram users well,
6
+ making it impossible to use certain handlers.
4
7
 
5
8
  ## Installation
6
9
 
@@ -10,10 +13,11 @@ Add lita-telegram-plus to your Lita instance's Gemfile:
10
13
  gem "lita-telegram-plus"
11
14
  ```
12
15
 
13
- ## Configuration
14
-
15
- TODO: Describe any configuration attributes the plugin exposes.
16
-
17
16
  ## Usage
18
17
 
19
- TODO: Describe the plugin's features and how to use them.
18
+ In `lita-config.rb`:
19
+
20
+ ```
21
+ config.robot.adapter = :telegram_plus
22
+ config.adapters.telegram_plus.token = "your telegram bot token here"
23
+ ```
@@ -15,7 +15,12 @@ module Lita
15
15
  def run
16
16
  @client.listen do |message|
17
17
  user = Lita::User.find_by_id(message.from.id)
18
- user = Lita::User.create(message.from.id) unless user
18
+ user = Lita::User.create(id: message.from.id, name: message.from.first_name) unless user
19
+
20
+ if user.name == user.id
21
+ user.name = message.from.first_name
22
+ user.save
23
+ end
19
24
 
20
25
  chat = Lita::Room.new(message.chat.id)
21
26
  source = Lita::Source.new(user: user, room: chat)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-telegram-plus"
3
- spec.version = "0.1.0"
3
+ spec.version = "0.1.1"
4
4
  spec.authors = ["Job van der Voort"]
5
5
  spec.email = ["jobvandervoort@gmail.com"]
6
6
  spec.description = "A better Telegram adapter for Lita"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-telegram-plus
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
  - Job van der Voort
@@ -116,6 +116,7 @@ extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
118
  - ".gitignore"
119
+ - CHANGELOG
119
120
  - Gemfile
120
121
  - README.md
121
122
  - Rakefile