// 當Bot已經加入對話、成員加入和離開對話、對話資料更改時 private async Task <Activity> HandleConversationUpdateMessage(Activity activity) { if (activity.MembersAdded.Any(o => o.Id == activity.From.Id)) { var context = BotDialogContext.Create(activity); await context.ReplyMessageAsync("哈囉!"); } return(activity); }
// 回覆語音 public static ResourceResponse ReplySpeakAsync(this IDialogContext context, string speakText, string inputHint = null, int waitTime = 0, bool isSendTyping = false) { var botContext = BotDialogContext.Create(context).EnableShowTyping(isSendTyping, waitTime); return(botContext.ReplySpeak(speakText: speakText, inputHint: inputHint)); }
public static ResourceResponse ReplyMedia(this IDialogContext context, string contentUrl, string contentType, string fileName, List <CardAction> suggestedActions = null, int waitTime = 0, bool isSendTyping = false) { var botContext = BotDialogContext.Create(context).EnableShowTyping(isSendTyping, waitTime); return(botContext.ReplyMedia(contentUrl: contentUrl, contentType: contentType, fileName: fileName, suggestedActions: suggestedActions)); }
public static ResourceResponse ReplyAttachment(this IDialogContext context, IEnumerable <Attachment> attachments, string text = null, string layout = AttachmentLayoutTypes.Carousel, List <CardAction> suggestedActions = null, int waitTime = 0, bool isSendTyping = false) { var botContext = BotDialogContext.Create(context).EnableShowTyping(isSendTyping, waitTime); return(botContext.ReplyAttachment(attachments: attachments, text: text, layout: layout, suggestedActions: suggestedActions)); }
// 回覆附件訊息 public static ResourceResponse ReplyAttachment(this IDialogContext context, Attachment attachment, string text = null, List <CardAction> suggestedActions = null, int waitTime = 0, bool isSendTyping = false) { var botContext = BotDialogContext.Create(context).EnableShowTyping(isSendTyping, waitTime); return(botContext.ReplyAttachment(attachment: attachment, text: text, suggestedActions: suggestedActions)); }
public static ResourceResponse ReplyMessage(this IDialogContext context, string message, string action, string actionName = null, int waitTime = 0, bool isSendTyping = false) { var botContext = BotDialogContext.Create(context).EnableShowTyping(isSendTyping, waitTime); return(botContext.ReplyMessage(message: message, action: action, actionName: actionName)); }
public static ResourceResponse ReplyMessage(this IDialogContext context, IMessageActivity message, int waitTime = 0, bool isSendTyping = false) { var botContext = BotDialogContext.Create(context).EnableShowTyping(isSendTyping, waitTime); return(botContext.ReplyMessage(message: message)); }
public static async Task <ResourceResponse> ReplyAttachmentAsync(this IDialogContext context, IEnumerable <Attachment> attachments, string text = null, string layout = AttachmentLayoutTypes.Carousel, List <CardAction> suggestedActions = null, int waitTime = 0, bool isSendTyping = false, CancellationToken cancellationToken = default(CancellationToken)) { var botContext = BotDialogContext.Create(context).EnableShowTyping(isSendTyping, waitTime); return(await botContext.ReplyAttachmentAsync(attachments : attachments, text : text, layout : layout, suggestedActions : suggestedActions, cancellationToken : cancellationToken)); }
public static async Task DeleteMessageAsync(this IDialogContext context, string activityId) { var botContext = BotDialogContext.Create(context); await botContext.DeleteMessageAsync(activityId); }
// 刪除訊息 public static void DeleteMessage(this IDialogContext context, string activityId) { var botContext = BotDialogContext.Create(context); botContext.DeleteMessage(activityId); }
public static async Task <ResourceResponse> UpdateMessageAsync(this IDialogContext context, string activityId, string message) { var botContext = BotDialogContext.Create(context); return(await botContext.UpdateMessageAsync(activityId, message)); }
// 修改訊息 public static ResourceResponse UpdateMessage(this IDialogContext context, string activityId, string message) { var botContext = BotDialogContext.Create(context); return(botContext.UpdateMessage(activityId, message)); }
// 回覆正在打字狀態 public static async Task <ResourceResponse> ReplyTypingAsync(this IDialogContext context, int waitTime = 0, bool isSendTyping = false, CancellationToken cancellationToken = default(CancellationToken)) { var botContext = BotDialogContext.Create(context).EnableShowTyping(isSendTyping, waitTime); return(await botContext.ReplyTypingAsync(cancellationToken : cancellationToken)); }
public static async Task <ResourceResponse> ReplyMediaAsync(this IDialogContext context, string contentUrl, string contentType, string fileName, List <CardAction> suggestedActions = null, int waitTime = 0, bool isSendTyping = false, CancellationToken cancellationToken = default(CancellationToken)) { var botContext = BotDialogContext.Create(context).EnableShowTyping(isSendTyping, waitTime); return(await botContext.ReplyMediaAsync(contentUrl : contentUrl, contentType : contentType, fileName : fileName, suggestedActions : suggestedActions, cancellationToken : cancellationToken)); }
// 回覆正在打字狀態 public static ResourceResponse ReplyTyping(this IDialogContext context, int waitTime = 0, bool isSendTyping = false) { var botContext = BotDialogContext.Create(context).EnableShowTyping(isSendTyping, waitTime); return(botContext.ReplyTyping()); }
public static async Task <ResourceResponse> ReplyMessageAsync(this IDialogContext context, string message, string action, string actionName = null, int waitTime = 0, bool isSendTyping = false, CancellationToken cancellationToken = default(CancellationToken)) { var botContext = BotDialogContext.Create(context).EnableShowTyping(isSendTyping, waitTime); return(await botContext.ReplyMessageAsync(message : message, action : action, actionName : actionName, cancellationToken : cancellationToken)); }
// 回覆訊息 public static ResourceResponse ReplyMessage(this IDialogContext context, string message, List <CardAction> suggestedActions = null, int waitTime = 0, bool isSendTyping = false) { var botContext = BotDialogContext.Create(context).EnableShowTyping(isSendTyping, waitTime); return(botContext.ReplyMessage(message: message, suggestedActions: suggestedActions)); }