TeamsInfo class
Provides utility methods for the events and interactions that occur within Microsoft Teams.
Methods
get |
Gets the information for the given meeting id. |
get |
Gets the meeting participant for the given meeting id and participant id. This only works in teams scoped meeting conversations. |
get |
Gets the account of a single conversation member. |
get |
Gets the conversation members of a one-on-one or group chat. |
get |
Gets a pagined list of members of one-on-one, group, or team conversation. |
get |
Gets a paginated list of members of a team. |
get |
Returns a list of channels in a Team. This only works in teams scoped conversations. |
get |
Gets the details for the given team id. This only works in teams scoped conversations. |
get |
Gets the account of a member in a teams scoped conversation. |
get |
Gets the list of TeamsChannelAccount within a team. |
send |
Creates a new thread in a Teams chat and sends an Activity to that new thread. |
Method Details
getMeetingInfo(TurnContext, string)
Gets the information for the given meeting id.
static function getMeetingInfo(context: TurnContext, meetingId?: string): Promise<TeamsMeetingInfo>
Parameters
- context
-
TurnContext
The TurnContext for this turn.
- meetingId
-
string
The BASE64-encoded id of the Teams meeting.
Returns
Promise<TeamsMeetingInfo>
The TeamsMeetingInfo fetched
getMeetingParticipant(TurnContext, string, string, string)
Gets the meeting participant for the given meeting id and participant id. This only works in teams scoped meeting conversations.
static function getMeetingParticipant(context: TurnContext, meetingId?: string, participantId?: string, tenantId?: string): Promise<TeamsMeetingParticipant>
Parameters
- context
-
TurnContext
The TurnContext for this turn.
- meetingId
-
string
The meeting ID to fetch
- participantId
-
string
The participant ID to fetch
- tenantId
-
string
The tenant ID to use when scoping the request
Returns
Promise<TeamsMeetingParticipant>
The TeamsMeetingParticipant fetched
getMember(TurnContext, string)
Gets the account of a single conversation member.
static function getMember(context: TurnContext, userId: string): Promise<TeamsChannelAccount>
Parameters
- context
-
TurnContext
The TurnContext for this turn.
- userId
-
string
ID of the user in question.
Returns
Promise<TeamsChannelAccount>
The TeamsChannelAccount of the member.
getMembers(TurnContext)
Warning
This API is now deprecated.
Use getPagedTeamMembers
instead.
Gets the conversation members of a one-on-one or group chat.
static function getMembers(context: TurnContext): Promise<TeamsChannelAccount[]>
Parameters
- context
-
TurnContext
The TurnContext for this turn.
Returns
Promise<TeamsChannelAccount[]>
The list of TeamsChannelAccount.
getPagedMembers(TurnContext, number, string)
Gets a pagined list of members of one-on-one, group, or team conversation.
static function getPagedMembers(context: TurnContext, pageSize?: number, continuationToken?: string): Promise<TeamsPagedMembersResult>
Parameters
- context
-
TurnContext
The TurnContext for this turn.
- pageSize
-
number
Suggested number of entries on a page.
- continuationToken
-
string
A continuation token.
Returns
Promise<TeamsPagedMembersResult>
The TeamsPagedMembersResult with the list of members.
getPagedTeamMembers(TurnContext, string, number, string)
Gets a paginated list of members of a team.
static function getPagedTeamMembers(context: TurnContext, teamId?: string, pageSize?: number, continuationToken?: string): Promise<TeamsPagedMembersResult>
Parameters
- context
-
TurnContext
The TurnContext for this turn.
- teamId
-
string
ID of the Teams team.
- pageSize
-
number
The number of entries on the page.
- continuationToken
-
string
The continuationToken token.
Returns
Promise<TeamsPagedMembersResult>
A TeamsPagedMembersResult with the list of members.
getTeamChannels(TurnContext, string)
Returns a list of channels in a Team. This only works in teams scoped conversations.
static function getTeamChannels(context: TurnContext, teamId?: string): Promise<ChannelInfo[]>
Parameters
- context
-
TurnContext
The TurnContext for this turn.
- teamId
-
string
ID of the Teams team.
Returns
Promise<ChannelInfo[]>
The list of ChannelInfo objects with the conversations.
getTeamDetails(TurnContext, string)
Gets the details for the given team id. This only works in teams scoped conversations.
static function getTeamDetails(context: TurnContext, teamId?: string): Promise<TeamDetails>
Parameters
- context
-
TurnContext
The TurnContext for this turn.
- teamId
-
string
The id of the Teams team.
Returns
Promise<TeamDetails>
The TeamDetails fetched
getTeamMember(TurnContext, string, string)
Gets the account of a member in a teams scoped conversation.
static function getTeamMember(context: TurnContext, teamId?: string, userId?: string): Promise<TeamsChannelAccount>
Parameters
- context
-
TurnContext
The TurnContext for this turn.
- teamId
-
string
ID of the Teams team.
- userId
-
string
ID of the Teams user.
Returns
Promise<TeamsChannelAccount>
The TeamsChannelAccount of the member.
getTeamMembers(TurnContext, string)
Warning
This API is now deprecated.
Use getPagedTeamMembers
instead.
Gets the list of TeamsChannelAccount within a team.
static function getTeamMembers(context: TurnContext, teamId?: string): Promise<TeamsChannelAccount[]>
Parameters
- context
-
TurnContext
The TurnContext for this turn.
- teamId
-
string
ID of the Teams team.
Returns
Promise<TeamsChannelAccount[]>
The list of TeamsChannelAccount of the members.
sendMessageToTeamsChannel(TurnContext, Activity, string, string)
Creates a new thread in a Teams chat and sends an Activity to that new thread.
static function sendMessageToTeamsChannel(context: TurnContext, activity: Activity, teamsChannelId: string, botAppId?: string): Promise<[ConversationReference, string]>
Parameters
- context
-
TurnContext
The TurnContext for this turn.
- activity
-
Activity
The Activity to send.
- teamsChannelId
-
string
The Team's Channel ID, note this is distinct from the Bot Framework activity property with same name.
- botAppId
-
string
The bot's appId. This is only used when context.adapter is an instance of CloudAdapter.
Returns
Promise<[ConversationReference, string]>
The ConversationReference and the id of the Activity (if sent).