public async void Execute(object parameter) { if (parameter is DiscordMessage message) { var dialog = new DeleteMessageDialog(message); if (await dialog.ShowAsync() == ContentDialogResult.Primary) { await message.DeleteAsync(); } } }
public async void Execute(object parameter) { Analytics.TrackEvent("DeleteMessageCommand_Invoked"); if (parameter is DiscordMessage message) { var dialog = new DeleteMessageDialog() { Message = message }; if (await dialog.ShowAsync() == ContentDialogResult.Primary) { Analytics.TrackEvent("DeleteMessageCommand_DeleteMessage"); await message.DeleteAsync(); } } }