title: Discord.net 1.0 - How to get Messages to delete?
body: <p>so I am having problems with my command. It doesn't seem to show any problems, but when I go to use the command i get this back from my bot. </p>
  
  <p>"ERROR:  The input text has too few parameters."</p>
  
  <p>I don't know if I should be using IUserMessage, or SocketMessage, i've tried both and usually get the same error.</p>
  
  <p>I don't know where I went wrong? I have tried to fix this for a while and i'm at a brick wall in trying to figure this out. Any help would be appreciated. </p>
  
  <pre><code>    [Command("purge")]
      [Summary("deletes set amount of text")]
      [RequireUserPermission(GuildPermission.Administrator)]
      [RequireBotPermission(GuildPermission.Administrator)]
      public async Task PurgeChat(IUserMessage msg, int amount)
      {
          int messagesDeleted = 0;
          var purgeMessage = await msg.Channel.SendMessageAsync("_purging in progress, give me a minute.._");
          var lastMessageID = purgeMessage.Id;
  
  
          try
          {
              var stop = false;
              while (amount &gt; messagesDeleted)
              {
                  var messages = await msg.Channel.GetMessagesAsync(lastMessageID, Direction.Before, 15).OfType&lt;IUserMessage&gt;().ToList();
                  foreach (IUserMessage message in messages)
                  {
                      await message.DeleteAsync();
                      messagesToDelete++;
                      if (messagesDeleted &gt;= amount || messages.Count == 0)
                      {
                          stop = true;
                          break;
                      }
                      lastMessageID = messages.Last().Id;
                  }
                  if (stop || messages.Count == 0)
                  {
                      break;
                  }
              }
          }
          catch (Exception ex)
          {
              if (ex.Message != "The server responded with error 404 (NotFound): \"Unknown Message\"")
              {
                  await Context.Channel.SendMessageAsync("Something fucked up while trying to delete messages, you are going to have to manually Delete them for now. or try again");
              }
          }
          finally
          {
              await purgeMessage.ModifyAsync(x =&gt; x.Content = "_Purge Completed, this message will self destruct in 5 seconds_");
              await Task.Factory.StartNew(async () =&gt;
               {
                   await Task.Delay(5000);
                   await purgeMessage.DeleteAsync();
               });
          }
      }
  </code></pre>