Comments (10)
When I use
bot.teams.getTeamDetails(bot.getConfig('context'));
I get the following error:
error TS2576: Property 'getTeamDetails' does not exist on type 'TeamsInfo'. Did you mean to access the static member 'TeamsInfo.getTeamDetails' instead?
from botkit.
@benbrown can you help here?
from botkit.
@MoosaSaadat I'm doing getMember to get user e-mail on 4.10.0
await bot.teams.getMember(bot.getConfig('context'), message.user);
from botkit.
@billyzoellers Although it works fine, I am using TypeScript and get the following error:
Property 'getMember' does not exist on type 'TeamsInfo'. Did you mean to access the static member 'TeamsInfo.getMember' instead? ts(2576)
I have to disable type check in order to compile it
// @ts-nocheck
from botkit.
Btw @benbrown when this issue is resolved, I can create a PR to update docs for using bot.teams.getMember()
instead of bot.api.getUserById()
from botkit.
Hi guys.
For historical accuracy - the doc you linked to in your OP is to the previous version of Botkit, not the current 4.0 version.
Accessing the bot.teams
object is what you want to do... However I am not sure how to deal with the static member warning. Disabling the type check should have no impact on the behavior...
from botkit.
@benbrown as per the specification of static:
Neither static methods nor static properties can be called on instances of the class
The error we are facing is also demonstrated in the first example:
class Triple {
...
static calculate(n = 1) {
return n * 3;
}
}
...
const tp = new Triple();
...
// This throws because calculate() is a static member, not an instance member.
console.log(tp.calculate()); // 'tp.calculate is not a function'
So, in our case, access to the TeamsInfo
class is required. It should be exported from botkit so that we can use it.
from botkit.
Can you import it directly from the botbuilder
library?
https://github.com/howdyai/botkit/blob/main/packages/botkit/src/core.ts#L374
from botkit.
Yes, I can import it directly and it works fine like that. But, I guess it is not a standard practice to import dependencies which are not mentioned in package.json
? Also, eslint
will show this problem:
'botbuilder' should be listed in the project's dependencies. Run 'npm i -S botbuilder' to add it - eslint [import/no-extraneous-dependencies](https://github.com/import-js/eslint-plugin-import/blob/v2.25.4/docs/rules/no-extraneous-dependencies.md)
Is there a way to list it in dependencies without having to download multiple versions of it? Will have to make sure that the listed dependency has the same version as botkit dependency to avoid unnecessary duplication.
from botkit.
@MoosaSaadat Correct, you should use the same version of botbuilder as Botkit to avoid conflicts.
from botkit.
Related Issues (20)
- Send proactive message on MS teams HOT 2
- botkit 4.15.0 and Webex Adapter 1.0.10 are not on NPM HOT 1
- How to upload this Bot to Teams? HOT 2
- Bot can send, but not receive anymore HOT 2
- Botkit Webex API client not returning data HOT 1
- Question: Handling Websocket terminations HOT 1
- Uncatchable throws on botbuilder-adapter-webex registerWebhookSubscription Functions HOT 19
- Conversation become "duplicated" when running long operation HOT 1
- Help in Implementing the B2C Chatbot
- Webex Teams Adapter Doesn't Support direct_mention Event Type
- ☺
- BotkitConversation not executing when using axios but its executing fine when calling inside request?
- Cannot read property '1' of undefined
- Block Action Issue (when 'Clear Selection' is clicked)
- Can I message a pages followers with this??
- Remove deprecated request package
- Is project Dead? HOT 2
- Botkit
- Server Crash due to Missing Credentials in Slack Adapter
- npm install -g yo generator-botkit HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from botkit.