telegram-scrum-bot 0.0.1 → 0.0.2

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
  SHA256:
3
- metadata.gz: 7b50013c70e528116d1d7320bb0334e99d3a9974216fa96379c85ebac7ce38fb
4
- data.tar.gz: b52fbdcb2033cbe23d6fa3545747561fe988e3639a4a6972004bf766758029a0
3
+ metadata.gz: a4ae321299b4e891424d806292ab0ff5379f3d1049e0b1b924beacf81c66f684
4
+ data.tar.gz: 4ba69fc7910ba8e4c664f60e1559c4d7fd55e812ac8f308c7bf0227350181bd5
5
5
  SHA512:
6
- metadata.gz: d50756eb900c94c9d5b6b31d6d65cef912e2706df12167c3a827f85861d0211454773eb026e9b3a8a521bdc6c2d1cda8b029b2810e718b8abe9fd05dad3fbaa1
7
- data.tar.gz: 6b258df630a4f5332c89ae2b98c32323ff1c7b30b561cfd9819b4e4e8d2b2481342eda3f5fd6fa28ad81753537e39238af8940ab24e42610813da726d9885d57
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
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
-
3
2
  require "bundler/setup"
4
3
  require "telegram-scrum-bot"
5
4
 
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
- config = YAML.load_file("./config/secrets.yml")
7
- TelegramBot::TelegramScrumBot.set_token(config['telegram']['token'])
8
- TelegramBot::set_trello_tokens(config['trello']['key'], config['trello']['token'])
9
- bot = TelegramBot::TelegramScrumBot.new(username: 'hackvan', repository: 'telegram-bot')
10
- bot.run
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
@@ -1,3 +1,3 @@
1
1
  module TelegramBot
2
- VERSION = "0.1.0"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -1,10 +1,11 @@
1
- # lib = File.expand_path("../lib", __FILE__)
2
- # $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
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 = '0.0.1'
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.1
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