private Task RunAsync(MessageDeletePayload payload, CoreMessage?message) { Client.Logger.Information( "Received Deleted Message [{Id}] with content '{Content}'.", payload.Id, message?.Content ?? "Unknown."); return(Task.CompletedTask); }
private async Task RunAsync(MessageDeletePayload messageDeletePayload) { var message = await Client.Cache.Messages.GetAsync(messageDeletePayload.Id, messageDeletePayload.ChannelId); if (message == null) { await Client.Cache.EditableMessages.DeleteAsync(messageDeletePayload.Id, messageDeletePayload.ChannelId); } else { await Task.WhenAll( Client.Cache.Messages.DeleteAsync(messageDeletePayload.Id, messageDeletePayload.ChannelId), Client.Cache.EditableMessages.DeleteAsync(messageDeletePayload.Id, messageDeletePayload.ChannelId)); } await Client.EventHandler.OnMessageDeleteAsync(messageDeletePayload, message); }
private async Task RunAsync(MessageDeletePayload messageDeletePayload) { await Task.WhenAll( Client.Cache.Messages.DeleteAsync(messageDeletePayload.Id, messageDeletePayload.ChannelId), Client.Cache.EditableMessages.DeleteAsync(messageDeletePayload.Id, messageDeletePayload.ChannelId)); }
private void Run(MessageDeletePayload messageDeletePayload) { Task.Run(() => RunAsync(messageDeletePayload)); }