rikutelebot 0.0.3 → 0.0.4
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/README.md +1 -5
- data/lib/rikutelebot/version.rb +1 -1
- data/lib/rikutelebot.rb +16 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 89edd11235002a6a91c082c027cb418d3a10773f
|
|
4
|
+
data.tar.gz: 786d6dd486ed0ffef10d573b6e2c04d64b2b292c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e5e28019c1cce1488c072cf2a7296b9cf9489eb5d8c8ad5785d61fa88e285a34f491c4168f9729c0cd119e6e0726e8efd5232e8064b5c06227de45e815badc5c
|
|
7
|
+
data.tar.gz: bb46cc88c05052a5c780e137e9695c8b18fbb29ea14c0f4626594306962c68d12095b25e5b664524589f229c9899a4b46503705d96523ba95898d1e791d329f5
|
data/README.md
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
# Rikutelebot
|
|
2
2
|
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rikutelebot`. To experiment with that code, run `bin/console` for an interactive prompt.
|
|
4
|
-
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
|
6
|
-
|
|
7
3
|
## Installation
|
|
8
4
|
|
|
9
5
|
Add this line to your application's Gemfile:
|
|
@@ -32,7 +28,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
32
28
|
|
|
33
29
|
## Contributing
|
|
34
30
|
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
31
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/LainLayer/rikutelebot.
|
|
36
32
|
|
|
37
33
|
## License
|
|
38
34
|
|
data/lib/rikutelebot/version.rb
CHANGED
data/lib/rikutelebot.rb
CHANGED
|
@@ -20,13 +20,23 @@ module Rikutelebot
|
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
Command = Struct.new(:command, :args) do
|
|
24
|
+
|
|
25
|
+
end
|
|
26
|
+
|
|
23
27
|
class Bot
|
|
24
28
|
def initialize
|
|
25
29
|
@conf = Config.new nil
|
|
30
|
+
@state = false
|
|
31
|
+
@commands = []
|
|
26
32
|
yield @conf
|
|
27
33
|
end
|
|
28
34
|
|
|
29
|
-
def
|
|
35
|
+
def get_message_array
|
|
36
|
+
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def on_message
|
|
30
40
|
updates = []
|
|
31
41
|
j = JSON.parse open(@conf.getupdatesurl).read()
|
|
32
42
|
for update in j['result']
|
|
@@ -39,7 +49,7 @@ module Rikutelebot
|
|
|
39
49
|
|
|
40
50
|
id = update['message']['chat']['id']
|
|
41
51
|
title = update['message']['chat']['title']
|
|
42
|
-
un = update['message']['chat']['username'] ||
|
|
52
|
+
un = update['message']['chat']['username'] || "(#{id}:#{title})"
|
|
43
53
|
|
|
44
54
|
chat = Chat.new(id, title, un)
|
|
45
55
|
|
|
@@ -47,6 +57,10 @@ module Rikutelebot
|
|
|
47
57
|
end
|
|
48
58
|
end
|
|
49
59
|
|
|
60
|
+
def commands
|
|
61
|
+
|
|
62
|
+
end
|
|
63
|
+
|
|
50
64
|
end
|
|
51
65
|
|
|
52
66
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rikutelebot
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Riku
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-12-
|
|
11
|
+
date: 2017-12-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|