botbuilder
Version:
Bot Builder is a framework for building rich bots on virtually any platform.
211 lines • 10.8 kB
TypeScript
/**
* @module botbuilder
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { Activity, ChannelInfo, TeamsChannelAccount, TeamDetails, TurnContext, TeamsPagedMembersResult, ConversationReference, TeamsMeetingParticipant, MeetingInfo, MeetingNotification, MeetingNotificationResponse, TeamsMember, BatchOperationResponse, BatchOperationStateResponse, BatchFailedEntriesResponse } from 'botbuilder-core';
import { CancelOperationResponse } from 'botframework-connector';
/**
* Provides utility methods for the events and interactions that occur within Microsoft Teams.
*/
export declare class TeamsInfo {
/**
* Gets the meeting participant for the given meeting id and participant id. This only works in
* teams scoped meeting conversations.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param meetingId The meeting ID to fetch
* @param participantId The participant ID to fetch
* @param tenantId The tenant ID to use when scoping the request
* @returns The [TeamsMeetingParticipant](xref:botbuilder-core.TeamsMeetingParticipant) fetched
*/
static getMeetingParticipant(context: TurnContext, meetingId?: string, participantId?: string, tenantId?: string): Promise<TeamsMeetingParticipant>;
/**
* Gets the information for the given meeting id.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param meetingId The BASE64-encoded id of the Teams meeting.
* @returns The [MeetingInfo](xref:botframework-schema.MeetingInfo) fetched
*/
static getMeetingInfo(context: TurnContext, meetingId?: string): Promise<MeetingInfo>;
/**
* Gets the details for the given team id. This only works in teams scoped conversations.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param teamId The id of the Teams team.
* @returns The [TeamDetails](xref:botbuilder-core.TeamDetails) fetched
*/
static getTeamDetails(context: TurnContext, teamId?: string): Promise<TeamDetails>;
/**
* Creates a new thread in a Teams chat and sends an [Activity](xref:botframework-schema.Activity) to that new thread.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param activity The [Activity](xref:botframework-schema.Activity) to send.
* @param teamsChannelId The Team's Channel ID, note this is distinct from the Bot Framework activity property with same name.
* @param botAppId The bot's appId. This is only used when context.adapter is an instance of CloudAdapter.
* @returns The [ConversationReference](xref:botframework-schema.ConversationReference) and the id of the [Activity](xref:botframework-schema.Activity) (if sent).
*/
static sendMessageToTeamsChannel(context: TurnContext, activity: Activity, teamsChannelId: string, botAppId?: string): Promise<[ConversationReference, string]>;
/**
* Returns a list of channels in a Team. This only works in teams scoped conversations.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param teamId ID of the Teams team.
* @returns The list of [ChannelInfo](xref:botframework-schema.ChannelInfo) objects with the conversations.
*/
static getTeamChannels(context: TurnContext, teamId?: string): Promise<ChannelInfo[]>;
/**
* Gets the conversation members of a one-on-one or group chat.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @returns The list of [TeamsChannelAccount](xref:botframework-schema.TeamsChannelAccount).
* @deprecated Use `getPagedTeamMembers` instead.
*/
static getMembers(context: TurnContext): Promise<TeamsChannelAccount[]>;
/**
* Gets a pagined list of members of one-on-one, group, or team conversation.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param pageSize Suggested number of entries on a page.
* @param continuationToken A continuation token.
* @returns The [TeamsPagedMembersResult](xref:botframework-schema.TeamsPagedMembersResult) with the list of members.
*/
static getPagedMembers(context: TurnContext, pageSize?: number, continuationToken?: string): Promise<TeamsPagedMembersResult>;
/**
* Gets the account of a single conversation member.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param userId ID of the user in question.
* @returns The [TeamsChannelAccount](xref:botframework-schema.TeamsChannelAccount) of the member.
*/
static getMember(context: TurnContext, userId: string): Promise<TeamsChannelAccount>;
/**
* Gets the list of [TeamsChannelAccount](xref:botframework-schema.TeamsChannelAccount) within a team.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param teamId ID of the Teams team.
* @returns The list of [TeamsChannelAccount](xref:botframework-schema.TeamsChannelAccount) of the members.
* @deprecated Use `getPagedTeamMembers` instead.
*/
static getTeamMembers(context: TurnContext, teamId?: string): Promise<TeamsChannelAccount[]>;
/**
* Gets a paginated list of members of a team.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param teamId ID of the Teams team.
* @param pageSize The number of entries on the page.
* @param continuationToken The continuationToken token.
* @returns A [TeamsPagedMembersResult](xref:botframework-schema.TeamsPagedMembersResult) with the list of members.
*/
static getPagedTeamMembers(context: TurnContext, teamId?: string, pageSize?: number, continuationToken?: string): Promise<TeamsPagedMembersResult>;
/**
* Gets the account of a member in a teams scoped conversation.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param teamId ID of the Teams team.
* @param userId ID of the Teams user.
* @returns The [TeamsChannelAccount](xref:botframework-schema.TeamsChannelAccount) of the member.
*/
static getTeamMember(context: TurnContext, teamId?: string, userId?: string): Promise<TeamsChannelAccount>;
/**
* Sends a meeting notification to specific users in a Teams meeting.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param notification The meeting notification payload.
* @param meetingId Id of the Teams meeting.
* @returns Promise with either an empty object if notifications were successfully sent to all recipients or
* [MeetingNotificationResponse](xref:botframework-schema.MeetingNotificationResponse) if notifications
* were sent to some but not all recipients.
*/
static sendMeetingNotification(context: TurnContext, notification: MeetingNotification, meetingId?: string): Promise<MeetingNotificationResponse>;
/**
* Sends a message to the provided users in the list of Teams members.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param activity The activity to send.
* @param tenantId The tenant ID.
* @param members The list of users recipients for the message.
* @returns Promise with operationId.
*/
static sendMessageToListOfUsers(context: TurnContext, activity: Activity, tenantId: string, members: TeamsMember[]): Promise<BatchOperationResponse>;
/**
* Sends a message to all the users in a tenant.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param activity The activity to send.
* @param tenantId The tenant ID.
* @returns Promise with operationId.
*/
static sendMessageToAllUsersInTenant(context: TurnContext, activity: Activity, tenantId: string): Promise<BatchOperationResponse>;
/**
* Sends a message to all the users in a team.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param activity The activity to send.
* @param tenantId The tenant ID.
* @param teamId The team ID.
* @returns Promise with operationId.
*/
static sendMessageToAllUsersInTeam(context: TurnContext, activity: Activity, tenantId: string, teamId: string): Promise<BatchOperationResponse>;
/**
* Sends a message to the provided list of Teams channels.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param activity The activity to send.
* @param tenantId The tenant ID.
* @param members The list of channels recipients for the message.
* @returns Promise with operationId.
*/
static sendMessageToListOfChannels(context: TurnContext, activity: Activity, tenantId: string, members: TeamsMember[]): Promise<BatchOperationResponse>;
/**
* Gets the operation state.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param operationId The operationId to get the state of.
* @returns Promise with The state and responses of the operation.
*/
static getOperationState(context: TurnContext, operationId: string): Promise<BatchOperationStateResponse>;
/**
* Gets the failed entries of an executed operation.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param operationId The operationId to get the failed entries of.
* @returns Promise with the list of failed entries of the operation.
*/
static getFailedEntries(context: TurnContext, operationId: string): Promise<BatchFailedEntriesResponse>;
/**
* Cancels a pending operation.
*
* @param context The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param operationId The id of the operation to cancel.
* @returns Promise representing the asynchronous operation.
*/
static cancelOperation(context: TurnContext, operationId: string): Promise<CancelOperationResponse>;
/**
* @private
*/
private static getMembersInternal;
/**
* @private
*/
private static getPagedMembersInternal;
/**
* @private
*/
private static getMemberInternal;
/**
* @private
*/
private static getTeamId;
/**
* @private
*/
private static getConnectorClient;
/**
* @private
*/
private static getTeamsConnectorClient;
}
//# sourceMappingURL=teamsInfo.d.ts.map