telegram-scrum-bot 0.0.1 → 0.0.2
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 +78 -0
- data/bin/console +0 -1
- data/lib/telegram-bot.rb +27 -5
- data/lib/telegram-bot/version.rb +1 -1
- data/telegram-scrum-bot.gemspec +4 -3
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a4ae321299b4e891424d806292ab0ff5379f3d1049e0b1b924beacf81c66f684
|
|
4
|
+
data.tar.gz: 4ba69fc7910ba8e4c664f60e1559c4d7fd55e812ac8f308c7bf0227350181bd5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a9d6b5ce93a5b0aad3ad398bd268f85bfe5e3b3326bb95029cf0eb8520ff4c5311e044c09e171c57b0808fb5fd6e21a134f4691741415bb33195f767e81d7ef4
|
|
7
|
+
data.tar.gz: 832857d9617c601b6c48849ae32778cca8c042dd6539df04cfca39a81ab85d44337269276fd14d518776fe00c3402f7f057ebe48012cfaf8d4780aa63d14f7c8
|
data/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Telegram Scrum Bot
|
|
2
|
+
|
|
3
|
+
A friendship Telegram's bot that connect a Repository on GitHub with a Scrum board on Trello.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
### From the Github Repository:
|
|
8
|
+
```bash
|
|
9
|
+
git clone https://github.com/hackvan/telegram-bot.git
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
For development you must be create the file `secrets.yml` inside the `config` directory and put the Telegram and Trello tokens information on this structure:
|
|
13
|
+
|
|
14
|
+
```yaml
|
|
15
|
+
telegram:
|
|
16
|
+
token: 'TOKEN-INFO'
|
|
17
|
+
trello:
|
|
18
|
+
key: 'KEY-INFO'
|
|
19
|
+
token: 'TOKEN-INFO'
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
to start the bot's server application:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
$ bundle install
|
|
26
|
+
$ bundle exec ruby lib/telegram-bot.rb
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### From the [rubygems site](https://rubygems.org/gems/telegram-scrum-bot):
|
|
30
|
+
|
|
31
|
+
>https://rubygems.org/gems/telegram-scrum-bot
|
|
32
|
+
|
|
33
|
+
you must setup the required enviroment variables inside `.bashrc` or `.zshrc` depend of your terminal configuration:
|
|
34
|
+
```bash
|
|
35
|
+
# Enviroment variables from telegram-scrum-bot gem:
|
|
36
|
+
export API_TELEGRAM_TOKEN="TOKEN-INFO"
|
|
37
|
+
export API_TRELLO_KEY="KEY-INFO"
|
|
38
|
+
export API_TRELLO_TOKEN="TOKEN-INFO"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
To install and execute the application:
|
|
42
|
+
```bash
|
|
43
|
+
$ gem install telegram-scrum-bot
|
|
44
|
+
$ telegram-scrum-bot
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Telegram Bot
|
|
48
|
+
|
|
49
|
+
* name: `scrum_hackathon_bot`
|
|
50
|
+
* username: `@scrum_hackathon_bot`
|
|
51
|
+
* url: [https://t.me/scrum_hackathon_bot](https://t.me/scrum_hackathon_bot)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
**Telegram Bot Commands:**
|
|
55
|
+
|
|
56
|
+
Initial Commands:
|
|
57
|
+
```
|
|
58
|
+
/start - bienvenida
|
|
59
|
+
/setup - asistente de configuración del bot
|
|
60
|
+
/help - ayuda con los comandos del bot
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Configuration Commands:
|
|
64
|
+
```
|
|
65
|
+
/setgithubuser - establece la configuración del usuario de github
|
|
66
|
+
/setgithubrepository - establece la configuración del repositorio de github
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
/getgithubuser - obtiene la configuración del usuario de github
|
|
71
|
+
/getgithubrepository - obtiene la configuración del repositorio de github
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Work Commands:
|
|
75
|
+
```
|
|
76
|
+
/issues - consultar el listado de Issues en el repositorio de Github
|
|
77
|
+
/trello - sincroniza los issues del repositorio en un tablero de Trello
|
|
78
|
+
```
|
data/bin/console
CHANGED
data/lib/telegram-bot.rb
CHANGED
|
@@ -3,8 +3,30 @@ require_relative 'telegram-bot/bot'
|
|
|
3
3
|
module TelegramBot
|
|
4
4
|
end
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
begin
|
|
7
|
+
# Search the config/secrets.yml used for development enviroment:
|
|
8
|
+
config = YAML.load_file("./config/secrets.yml")
|
|
9
|
+
API_TELEGRAM_TOKEN = config['telegram']['token']
|
|
10
|
+
API_TRELLO_KEY = config['trello']['key']
|
|
11
|
+
API_TRELLO_TOKEN = config['trello']['token']
|
|
12
|
+
rescue Errno::ENOENT => exception
|
|
13
|
+
# Search enviroment variables used for production enviroment:
|
|
14
|
+
API_TELEGRAM_TOKEN = ENV['API_TELEGRAM_TOKEN']
|
|
15
|
+
API_TRELLO_KEY = ENV['API_TRELLO_KEY']
|
|
16
|
+
API_TRELLO_TOKEN = ENV['API_TRELLO_TOKEN']
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
if API_TELEGRAM_TOKEN
|
|
20
|
+
TelegramBot::TelegramScrumBot.set_token(API_TELEGRAM_TOKEN)
|
|
21
|
+
if API_TRELLO_KEY && API_TRELLO_TOKEN
|
|
22
|
+
TelegramBot::set_trello_tokens(API_TRELLO_KEY, API_TRELLO_TOKEN)
|
|
23
|
+
bot = TelegramBot::TelegramScrumBot.new(username: 'hackvan', repository: 'telegram-bot')
|
|
24
|
+
bot.run
|
|
25
|
+
else
|
|
26
|
+
puts "API_TRELLO_KEY and API_TRELLO_TOKEN is not defined."
|
|
27
|
+
exit 1
|
|
28
|
+
end
|
|
29
|
+
else
|
|
30
|
+
puts "API_TELEGRAM_TOKEN is not defined."
|
|
31
|
+
exit 1
|
|
32
|
+
end
|
data/lib/telegram-bot/version.rb
CHANGED
data/telegram-scrum-bot.gemspec
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
|
+
require "telegram-bot/version"
|
|
3
4
|
|
|
4
5
|
Gem::Specification.new do |spec|
|
|
5
6
|
spec.name = 'telegram-scrum-bot'
|
|
6
7
|
spec.date = '2018-09-30'
|
|
7
|
-
spec.version =
|
|
8
|
+
spec.version = TelegramBot::VERSION
|
|
8
9
|
spec.authors = ["Diego Camacho"]
|
|
9
10
|
spec.email = 'hackvan@gmail.com'
|
|
10
11
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: telegram-scrum-bot
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Diego Camacho
|
|
@@ -91,6 +91,7 @@ files:
|
|
|
91
91
|
- ".rspec"
|
|
92
92
|
- Gemfile
|
|
93
93
|
- Gemfile.lock
|
|
94
|
+
- README.md
|
|
94
95
|
- bin/console
|
|
95
96
|
- bin/setup
|
|
96
97
|
- exe/telegram-scrum-bot
|