lita-telegram-plus 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +8 -0
- data/README.md +10 -6
- data/lib/lita/adapters/telegram_plus.rb +6 -1
- data/lita-telegram-plus.gemspec +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7a6f3680456482d100037784fba1409e30d9407c
|
|
4
|
+
data.tar.gz: 08400c243d5efcc0dd88720e11782378ccd75dac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 29f457fd036e2d138d2e16906c1e88ccad0ed65c32cc71d8edce7a2e2548da891752430c465ffe30a1d0b8acbdf68b60af3652afc59285c7b5a0ccafba3a03c3
|
|
7
|
+
data.tar.gz: 4d9a5f6048c94f88d39d8a70de9ae5da206f9bcdf02180cf7dfdbdcd712696f1cfb924ba740220aea5625f24bb02257b2ded9ab40bad5410df1a2a169b1bfede
|
data/CHANGELOG
ADDED
data/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# lita-telegram-plus
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
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)
|
data/lita-telegram-plus.gemspec
CHANGED
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.
|
|
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
|