public async Task <string> MessageSendMiniProgram(string conversationId, MiniProgramPayload miniProgramPayload) { var request = new MessageSendMiniProgramRequest(); request.ConversationId = conversationId; request.MiniProgram = JsonConvert.SerializeObject(miniProgramPayload); var response = await grpcClient.MessageSendMiniProgramAsync(request); return(response?.Id); }
/// <summary> /// create <see cref="MiniProgram"/>, not implemented yet. /// </summary> /// <returns></returns> #pragma warning disable CS1998 // 异步方法缺少 "await" 运算符,将以同步方式运行 public static async Task <MiniProgram> Create() #pragma warning restore CS1998 // 异步方法缺少 "await" 运算符,将以同步方式运行 { // TODO: get appid and username from wechat // the same implement as ts 😁 var payload = new MiniProgramPayload { Appid = "todo", Description = "todo", PagePath = "todo", ThumbKey = "todo", ThumbUrl = "todo", Title = "todo", Username = "******" }; return(new MiniProgram(payload)); }
public abstract Task <string?> MessageSendMiniProgram(string conversationId, MiniProgramPayload miniProgramPayload);
/// <summary> /// init <see cref="MiniProgram"/> with payload /// </summary> /// <param name="payload"></param> public MiniProgram(MiniProgramPayload payload) => Payload = payload;
public async Task<IMessageAppService> Say(MiniProgramPayload miniProgram) { var msgId = await _puppetService.MessageSendMiniProgram(RoomId, miniProgram); return await TryLoad(msgId); }