예제 #1
0
 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();
         }
     }
 }
예제 #2
0
        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();
                }
            }
        }