Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. @client.command(pass_context=True)
  2. async def badminton(ctx):
  3. badmintonplayers = random.choice([x for x in ctx.message.server.members if not x.bot])
  4. await client.say("You are now competing with {}.".format(badmintonplayers))
  5. await client.say("It's your turn to serve. Serve high or low?")
  6.  
  7. def check(m):
  8. return 'High','Low'
  9.  
  10. message = await client.wait_for_message()
  11. if 'High' in message.content:
  12. await client.say("You served a high ball!")
  13. elif 'Low' in message.content:
  14. await client.say("You served a low ball!")
  15. else:
  16. await client.say("You randomly served the ball, and the referee gives you a foul! Match ended!")
  17.  
  18. playerserve = random.choice(["The player sucessfully hit the ball!","The player missed the ball!"])
  19. playerstatus = await client.say(playerserve)
  20. playerhit = random.choice(["The player hits a high ball!","The player hits a low ball!"])
  21.  
  22. if 'The player sucessfully hit the ball!' in playerserve:
  23. await client.say("{} Where should you be? Behind or Front?".format(playerhit))
  24. elif 'The player missed the ball!' in playerserve:
  25. await client.say("Congratulations! You won!")
  26.  
  27. def check(m):
  28. return 'Behind','Front'
  29.  
  30. message2 = await client.wait_for_message()
  31. if 'Behind' in message.content:
  32. await client.say("You went backwards!")
  33. elif 'Front' in message.content:
  34. await client.say("You went forward!")
  35. else:
  36. await client.say("You rushed off and people thought you raged quit! Match ended!")
  37.  
  38. shuttercock = random.choice(["The ball lands an in! You lost!","However, the ball lands an out! You won!"])
  39.  
  40. if 'The player hits a low ball!' in playerhit:
  41. if 'Front' in message.content:
  42. await client.say("You feel like you can hit the ball! High or low?")
  43. elif 'Behind' in message.content:
  44. await client.say("Oh no! You are unable to hit the ball!")
  45. await client.say("It's an in! You lost!")
  46. elif 'The player hits a high ball!' in playerhit:
  47. if 'Behind' in message.content:
  48. await client.say("You feel like you can hit the ball! High or low?")
  49. elif 'Front' in message.content:
  50. await client.say("Oh no! You are unable to hit the ball!")
  51. await client.say(shuttercock)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement