daily pastebin goal
51%
SHARE
TWEET

things i cant find out how to do

EmilSkibrek Feb 11th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 1.
  2.  
  3. if response == 'randpass':
  4.       char = "abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()?"
  5.       total_len = 8
  6.       final =  "".join(random.sample(char, total_len))
  7.       await self.client.send_message(message.channel, "Check your dms {0.author.mention}".format(message))
  8.       await self.client.send_message(message.author, "You password is ")
  9.       await self.client.send_message(message.author, final)
  10.  
  11. 2.
  12.  
  13. if response == "rolldice":
  14.       num = str(randint(1, 6))
  15.       msg = "You rolled " + num
  16.       await self.client.send_message(message.channel, msg)
  17.  
  18. 3.
  19.  
  20. if message.content.startswith('.guess'):
  21.         await client.send_message(message.channel,
  22.                                   'Guess a number between 1 to 10')
  23.  
  24.         tries = 0
  25.         answer = random.randint(1, 10)
  26.         print(answer)
  27.  
  28.         def guess_check(m):
  29.             return m.content.isdigit()
  30.  
  31.         while tries < 3:
  32.             guess = await client.wait_for_message(
  33.                 timeout=5.0, author=message.author, check=guess_check)
  34.  
  35.             tries = tries + 1
  36.             if int(guess.content) < answer:
  37.                 await client.send_message(message.channel,
  38.                                           "Your guess is too low")
  39.             elif int(guess.content) > answer:
  40.                 await client.send_message(message.channel,
  41.                                           "Your guess is too high")
  42.             if int(guess.content) == answer:
  43.                 break
  44.  
  45.             if int(guess.content) < 1 or int(guess.content) > 10:
  46.                 await client.send_message(
  47.                     message.channel,
  48.                     "Please type only number between 1 to 10....Try again")
  49.  
  50.         if int(guess.content) == answer:
  51.             tries = str(tries)
  52.             msg = "You guessed my number in " + tries + " tries. GG"
  53.             await client.send_message(message.channel, msg)
  54.         else:
  55.             await client.send_message(
  56.                 message.channel, 'Sorry. It is actually {}.'.format(answer))
  57.  
  58.         if guess is None:
  59.             fmt = 'Sorry, you took too long. It was {}.'
  60.             await client.send_message(message.channel, fmt.format(answer))
  61.             return
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top