private async Task RunAsync(Message rawMessage) { var message = CoreMessage.From(Client, rawMessage); await message.CacheAsync(); await Client.EventHandler.OnMessageCreateAsync(message); }
private async Task RunAsync(MessageUpdatePayload messageUpdate) { var previousMessage = await Client.Cache.Messages.GetAsync(messageUpdate.Id); var message = previousMessage == null ? CoreMessage.From(Client, messageUpdate) : previousMessage.Clone().Patch(messageUpdate); await message.CacheAsync(); await Client.EventHandler.OnMessageUpdateAsync(previousMessage, message); }