Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Slack's users.lookupByEmail API is not available #1278

Closed
piglovesyou opened this issue Mar 6, 2018 · 4 comments · Fixed by #1285
Closed

Slack's users.lookupByEmail API is not available #1278

piglovesyou opened this issue Mar 6, 2018 · 4 comments · Fixed by #1285

Comments

@piglovesyou
Copy link
Contributor

The doc says "it may call any of these methods" but users.lookupByEmail is not available.

How can I report this or where I can see progress of API support?

@peterswimm
Copy link
Contributor

How are you trying to call it? Can you post what code you tried that is not working?

@piglovesyou
Copy link
Contributor Author

Thank you, I did it just in a console on IntelliJ break point. I'll try it in a code later.

@piglovesyou
Copy link
Contributor Author

piglovesyou commented Mar 7, 2018

@peterswimm It is something like this

import Botkit from 'botkit';

const controller = Botkit.slackbot({
  debug: true,
  scopes: ['bot', 'users:read.email'],
});

const bot = controller.spawn({
  token: process.env.token
}).startRTM();

controller.hears('hello', ['direct_message', 'direct_mention', 'mention'], (bot, message: Message) => {
  bot.api.users.lookupByEmail({email: '[email protected]'}, function (err, response) {
    console.log(response);
  });
});

And I got this

debug: RECEIVED MESSAGE
debug: CUSTOM FIND CONVO W8TUH1J6Q C9L7K86DV direct_mention
debug: I HEARD [ 'hello' ]
An error occured in the categorize middleware:  TypeError: bot.api.users.lookupByEmail is not a function
    at controller.hears (/xxx/src/main.js:14:17)
    at /xxx/node_modules/botkit/lib/CoreBot.js:1251:32
    at next (/xxx/node_modules/ware/lib/index.js:82:27)
    at Ware.run (/xxx/node_modules/ware/lib/index.js:88:3)
    at Object.<anonymous> (/xxx/node_modules/botkit/lib/CoreBot.js:1250:49)

piglovesyou added a commit to piglovesyou/botkit that referenced this issue Mar 13, 2018
@shishirsharma
Copy link
Contributor

@piglovesyou Please open this as a PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants