Permalink
Browse files

Merge pull request #21 from anonrig/multiple-question-list

Enable channel specific questions.
  • Loading branch information...
2 parents 02020c4 + 4f3382e commit 27260dbdbbb317b53c25e9d9dd704189e966660a @anonrig committed on GitHub Jun 15, 2016
Showing with 50 additions and 11 deletions.
  1. +29 −1 README.md
  2. +19 −5 config/default.json
  3. +2 −5 src/models/meeting.js
View
@@ -7,6 +7,7 @@ Advantages of Slack Manager from other services:
- Free and easy to use.
- Configurable mail settings.
- Configurable questions.
+ - Works with multiple channels.
![alt text](http://new.tinygrab.com/783f33d7b18d7bcd72f1de9785bcbf86e10c3eb82a.png "Slack-Manager")
@@ -50,14 +51,41 @@ For example for Gmail settings: change your settings file by:
}
```
+Configure your questions
+
+Open default.json and add a questions field shown below.
+
+slack-manager lets users to ask different questions to different channels. If you prefer a single question list
+then you will only need the default field of the questions object. If you want to ask different questions to different channels
+then you will need to add additional fields to the questions object. Fields of the questions object must be the names of the
+corresponding channels.
+
+Note: If no questions that has the same name as the channel found then the default list will be asked.
+
+```
+"questions": {
+ "default": [
+ "What did you do yesterday?",
+ "What are you going to do today?",
+ "Did you encounter any problems?"
+ ],
+ "CHANNEL-NAME": [
+ "How do you feel?"
+ ],
+ "ANOTHER-CHANNEL-NAME": [
+ "Another question?",
+ "Perhaps more?"
+ ]
+}
+```
+
## Usage
### Install dependencies
```
npm install
```
-
### Start your bot.
```
View
@@ -1,7 +1,21 @@
{
- "port": 3000,
- "mail": {
- "from": "Name Surname <YOUR MAIL>",
- "to": "Recepients(can write multiple separating with a comma ',')"
- }
+ "port": 3000,
+ "mail": {
+ "from": "Name Surname <YOUR MAIL>",
+ "to": "Recepients(can write multiple separating with a comma ',')"
+ },
+ "questions": {
+ "default": [
+ "What did you do yesterday?",
+ "What are you going to do today?",
+ "Did you encounter any problems?"
+ ],
+ "CHANNEL-NAME": [
+ "How do you feel?"
+ ],
+ "ANOTHER-CHANNEL-NAME": [
+ "Another question?",
+ "Perhaps more?"
+ ]
+ }
}
View
@@ -17,11 +17,7 @@ class meeting extends EventEmitter {
constructor(channelId) {
super();
this.channelId = channelId;
- this.questions = [
- 'What did you do yesterday?',
- 'What are you going to do today?',
- 'Did you encounter any problems?'
- ];
+ this.channelName = '';
this.answers = [];
this.isActive = true;
}
@@ -46,6 +42,7 @@ class meeting extends EventEmitter {
* @return {Promise}
*/
start(bot, message) {
+ this.questions = config.get('questions:' + this.channelName) || config.get('questions:default');
let that = this;
let participantCount = 0;

0 comments on commit 27260db

Please sign in to comment.