Guest User

Untitled

a guest
Jun 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. [Command("rps")]
  2. public async Task RockPaperScissor(string rps = null)
  3. {
  4. if (rps is null)
  5. {
  6. await ReplyAsync("You do not have choosen one of the options Rock, Paper or scissor.");
  7. return;
  8. }
  9.  
  10. if (rps.Contains("rock"))
  11. {
  12. string message = "You chose Rock, I chose Scissor.\n So you won :c|You chose Rock, I chose Paper.\n So I won :3|You chose Rock, I chose Rock too!\n So its a draw :o";
  13. string[] options = message.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
  14.  
  15. Random r = new Random();
  16. string selection = options[r.Next(0, options.Length)];
  17. await ReplyAsync(selection);
  18. return;
  19. }
  20.  
  21. if (rps.Contains("paper"))
  22. {
  23. string message = "You chose Paper, I chose Scissor.\n So I won :3|You chose Paper, I chose Paper too!\n So its a draw :o|You chose Paper, I chose Rock.\n So you won :c";
  24. string[] options = message.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
  25.  
  26. Random r = new Random();
  27. string selection = options[r.Next(0, options.Length)];
  28. await ReplyAsync(selection);
  29. return;
  30. }
  31.  
  32. if (rps.Contains("scissor"))
  33. {
  34. string message = "You chose Scissor, I chose Scissor too!\n So its a draw :o|You chose Scissor, I chose Paper.\n So you won :c|You chose Scissor, I chose Rock.\n So I won :3";
  35. string[] options = message.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
  36.  
  37. Random r = new Random();
  38. string selection = options[r.Next(0, options.Length)];
  39. await ReplyAsync(selection);
  40. return;
  41. }
  42.  
  43. await ReplyAsync($"{rps} isn't one of the options! choose Rock, Paper or scissor! :3");
  44. }
Add Comment
Please, Sign In to add comment