Browse Source

remove channels because it's not required

Outsider 10 years ago
parent
commit
cd556526c0
3 changed files with 3 additions and 35 deletions
  1. 1 18
      README.md
  2. 2 14
      config.js
  3. 0 3
      routes/index.js

+ 1 - 18
README.md

@@ -20,27 +20,10 @@ fill out `config.js` as your infomation.
 
   ```shell
    curl -X POST 'https://YOUR-SLACK-TEAM.slack.com/api/users.admin.invite' \
-   --data 'email=EMAIL&channels=CHANNEL_ID&token=TOKEN&set_active=true' \
+   --data 'email=EMAIL&token=TOKEN&set_active=true' \
    --compressed
   ```
 
-* `channels` : channels to join when the user is invited.(Array)
-  You can find id of channels in your slack.(look at sidebar on the left)
-
-  channel list's HTML looks like:
-
-  ```html
-  <li class="channel_C024R4462 channel ">
-    <a class="channel_name" data-channel-id="C024R4462">
-      <span class="unread_just_C024R4462 unread_just hidden">0</span>
-      <span class="unread_highlight_C024R4462 unread_highlight hidden">0</span>
-      <span class="overflow-ellipsis"><span class="prefix">#</span>codeport</span>
-    </a>
-  </li>
-  ```
-
-  the value of `data-channel-id` is channel id.(`C024R44` in above example)
-
 ## Run
 [Node.js](http://nodejs.org/) is required.
 

+ 2 - 14
config.js

@@ -8,19 +8,7 @@ module.exports = {
   //
   // You can test your token via curl:
   //   curl -X POST 'https://YOUR-SLACK-TEAM.slack.com/api/users.admin.invite' \
-  //   --data 'email=EMAIL&channels=CHANNEL_ID&token=TOKEN&set_active=true' \
+  //   --data 'email=EMAIL&token=TOKEN&set_active=true' \
   //   --compressed
-  slacktoken: 'YOUR-ACCESS-TOKEN',
-  // channels to join when the user is invited.(Array of channel-id)
-  // You can find id of channels in your slack.(look at sidebar on the left)
-  // channel list's HTML looks like:
-  //   <li class="channel_C024R4462 channel ">
-  //     <a class="channel_name" data-channel-id="C024R4462">
-  //       <span class="unread_just_C024R4462 unread_just hidden">0</span>
-  //       <span class="unread_highlight_C024R4462 unread_highlight hidden">0</span>
-  //       <span class="overflow-ellipsis"><span class="prefix">#</span>codeport</span>
-  //     </a>
-  //   </li>
-  // "C024R4462" is channel id(in data-channel-id)
-  channels: ["CHANNEL-ID", "CHANNEL-ID"].join(',')
+  slacktoken: 'YOUR-ACCESS-TOKEN'
 };

+ 0 - 3
routes/index.js

@@ -13,7 +13,6 @@ router.post('/invite', function(req, res) {
         url: 'https://'+ config.slackUrl + '/api/users.admin.invite',
         form: {
           email: req.body.email,
-          channels: config.channels,
           token: config.slacktoken,
           set_active: true
         }
@@ -21,8 +20,6 @@ router.post('/invite', function(req, res) {
         // body looks like:
         //   {"ok":true}
         //       or
-        //   {"ok":false,"error":"channel_not_found"}
-        //       or
         //   {"ok":false,"error":"already_invited"}
         if (err) { return res.send('Error:' + err); }
         body = JSON.parse(body);