public async void Execute(object parameter) { if (parameter is DiscordMember member) { var banDialog = new BanDialog(member); var result = await banDialog.ShowAsync(); if (result == ContentDialogResult.Primary) { await member.BanAsync(banDialog.DeleteMessageDays, banDialog.BanReason); } } }
public async void Execute(object parameter) { if (parameter is DiscordMember member) { Analytics.TrackEvent("BanCommand_Invoked"); var banDialog = new BanDialog(member); var result = await banDialog.ShowAsync(); if (result == ContentDialogResult.Primary) { Analytics.TrackEvent("BanCommand_BanMember"); await member.BanAsync(banDialog.DeleteMessageDays, banDialog.BanReason); } } }