Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.36 KB | None | 0 0
  1.  
  2. def decrypt(decryptmessage):
  3. decrypted = ""
  4. for char in decryptmessage:
  5. if char in alphabet:
  6. newpos = (alphabet.find(char) - shift) % 26
  7. decrypted += alphabet[newpos]
  8. else:
  9. decrypted += char
  10. return decrypted
  11.  
  12. @client.event
  13. async def on_ready():
  14. print("-+-+-+-+-+-+-+-+-+-+-+-+-+-")
  15. print("BOT is UP and RUNNING.")
  16. print("Name: " + client.user.name)
  17. print("ID: " + client.user.id)
  18. print("-+-+-+-+-+-+-+-+-+-+-+-+-+-")
  19.  
  20. @client.command(pass_context=True)
  21. async def help(ctx):
  22. embed = discord.Embed(title="Jump-Rope in Python", description="Multi-Purpose Bot with multiple commands...", color=0xA52A2A)
  23. embed.add_field(name="^help", value="Opens this menu.", inline=False)
  24. embed.add_field(name="^cf", value="Flips a coin to settle an arguement!", inline=False)
  25. embed.add_field(name="^clear (value)", value="Clears messages in the given channel by (value).", inline=False)
  26. embed.add_field(name="^ping", value="Returns pong!", inline=False)
  27. embed.add_field(name="^dice", value="Rolls a dice!", inline=False)
  28. embed.add_field(name="^randomn var1 var2", value="Choses a random number between var1 and var2.", inline=False)
  29. embed.add_field(name="^e message", value="Encrypts a message.", inline=False)
  30. embed.add_field(name="^d message", value="Decrypts a message.", inline=False)
  31. embed.add_field(name="^add a b", value="adds two numbers.", inline=False)
  32. embed.add_field(name="^subtract a b", value="subtracts two numbers.", inline=False)
  33. embed.add_field(name="^multiply a b", value="multiplies two numbers.", inline=False)
  34. embed.add_field(name="^divide a b", value="divides two numbers.", inline=False)
  35. embed.add_field(name="^passgene (length)", value="Generates a random alphanumeric password.", inline=False)
  36. embed.add_field(name="^fortnite (pc, xbox, ps) (username)", value="Gets the fortnite stats of the player on a given console.", inline=False)
  37. embed.add_field(name="^sort (a or d) (list)", value="Sorts a list in either descending or ascending order. (for list, 1,2,5,3,6)", inline=False)
  38. await client.send_message(ctx.message.channel, embed=embed)
  39.  
  40. @client.command(pass_context=True)
  41. async def invite(ctx):
  42.  
  43.  
  44. @client.command(pass_context=True)
  45. async def fortnite(ctx, console: str, name: str):
  46. embed = discord.Embed(title="", description="", color = 0xA52A2A)
  47. urlpc = "https://fortnitetracker.com/profile/pc/"
  48. urlxbox = "https://fortnitetracker.com/profile/xbox/"
  49. urlps = "https://fortnitetracker.com/profile/psn/"
  50. if console == "pc":
  51. embed.add_field(name="Fortnite Module:", value=urlpc + name, inline=False)
  52. await client.send_message(ctx.message.channel, embed=embed)
  53. elif console == "xbox":
  54. embed.add_field(name="Fortnite Module:", value=urlxbox + name, inline=False)
  55. await client.send_message(ctx.message.channel, embed=embed)
  56. elif console == "ps":
  57. embed.add_field(name="Fortnite Module:", value=urlps + name, inline=False)
  58. await client.send_message(ctx.message.channel, embed=embed)
  59.  
  60. @client.command(pass_context=True)
  61. async def passgene(ctx, length: int):
  62. embed = discord.Embed(title="", descrption="", color = 0xA52A2A)
  63. abcpass = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  64.  
  65. pick = random.randint(1,62)
  66.  
  67.  
  68.  
  69. @client.command(pass_context=True)
  70. async def dice(ctx):
  71. embed = discord.Embed(title="", description="", color = 0xA52A2A)
  72. diceroll = random.randint(1,6)
  73. if diceroll == 1:
  74. embed.set_image(url="https://media.discordapp.net/attachments/459055554229174292/459384018165825547/graffiti_number_1.png?width=375&height=375")
  75. await client.send_message(ctx.message.channel, embed=embed)
  76. elif diceroll == 2:
  77. embed.set_image(url="https://media.discordapp.net/attachments/459055554229174292/459383194450657282/ca6e4320566287.png?width=375&height=375")
  78. await client.send_message(ctx.message.channel, embed=embed)
  79. elif diceroll == 3:
  80. embed.set_image(url="https://media.discordapp.net/attachments/459055554229174292/459383617454342154/graffiti_number_3.png?width=375&height=375")
  81. await client.send_message(ctx.message.channel, embed=embed)
  82. elif diceroll == 4:
  83. embed.set_image(url="https://media.discordapp.net/attachments/459055554229174292/459383724430065664/graffiti_number_4.png?width=375&height=375")
  84. await client.send_message(ctx.message.channel, embed=embed)
  85. elif diceroll == 5:
  86. embed.set_image(url="https://media.discordapp.net/attachments/459055554229174292/459383789622132737/graffiti_number_5.png?width=375&height=375")
  87. await client.send_message(ctx.message.channel, embed=embed)
  88. else:
  89. embed.set_image(url="https://media.discordapp.net/attachments/459055554229174292/459383842017509376/graffiti_number_6.png?width=375&height=375")
  90. await client.send_message(ctx.message.channel, embed=embed)
  91.  
  92. @client.command(pass_context=True)
  93. async def sort(ctx, choice: str, sortlist: str):
  94. embed = discord.Embed(title="", description="", color = 0xA52A2A)
  95. if choice == "a":
  96. listascend = sortlist.split(",")
  97. integerascendlist = []
  98. for numbers in listascend:
  99. integerascendlist.append(float(numbers))
  100. integerascendlist.sort()
  101. embed.add_field(name="Sort Ascend Module:", value=integerascendlist, inline=False)
  102. await client.send_message(ctx.message.channel, embed=embed)
  103. elif choice == "d":
  104. listdescend = sortlist.split(",")
  105. integerdescendlist = []
  106. for numbers in listdescend:
  107. integerdescendlist.append(float(numbers))
  108. integerdescendlist.sort(reverse=True)
  109. embed.add_field(name="Sort Descend Module:", value=integerdescendlist, inline=False)
  110. await client.send_message(ctx.message.channel, embed=embed)
  111.  
  112. @client.command(pass_context=True)
  113. async def randomn(ctx, var1: int, var2: int):
  114. embed = discord.Embed(title="", description="", color = 0xA52A2A)
  115. randomnum = random.randint(var1,var2)
  116. embed.add_field(name="Randomizer Module:", value=randomnum, inline=False)
  117. await client.send_message(ctx.message.channel, embed=embed)
  118.  
  119. @client.command(pass_context=True)
  120. async def add(ctx, a: int, b: int):
  121. embed = discord.Embed(title="", description="", color = 0xA52A2A)
  122. embed.add_field(name="Addition Module:", value=a+b, inline=False)
  123. await client.send_message(ctx.message.channel, embed=embed)
  124.  
  125. @client.command(pass_context=True)
  126. async def subtract(ctx, a: int, b: int):
  127. embed = discord.Embed(title="", description="", color = 0xA52A2A)
  128. embed.add_field(name="Subtraction Module:", value=a-b, inline=False)
  129. await client.send_message(ctx.message.channel, embed=embed)
  130.  
  131. @client.command(pass_context=True)
  132. async def multiply(ctx, a: int, b: int):
  133. embed = discord.Embed(title="", description="", color = 0xA52A2A)
  134. embed.add_field(name="Multiply Module:", value=a*b, inline=False)
  135. await client.send_message(ctx.message.channel, embed=embed)
  136.  
  137. @client.command(pass_context=True)
  138. async def divide(ctx, a: int, b: int):
  139. embed = discord.Embed(title="", description="", color = 0xA52A2A)
  140. embed.add_field(name="Division Module:", value=a/b, inline=False)
  141. await client.send_message(ctx.message.channel, embed=embed)
  142.  
  143. @client.command(pass_context=True)
  144. async def cf(ctx):
  145. embed = discord.Embed(title="", description="", color = 0xA52A2A)
  146. choice = random.randint(1,2)
  147. if choice == 1:
  148. embed.set_image(url="https://media.discordapp.net/attachments/459055554229174292/459365408785563648/Super-Bowl-Coin-Toss-Heads-020316L.png?width=338&height=338")
  149. await client.send_message(ctx.message.channel, embed=embed)
  150. else:
  151. embed.set_image(url="https://cdn.discordapp.com/attachments/459055554229174292/459366194357469184/51NyMaKLydL.png")
  152. await client.send_message(ctx.message.channel, embed=embed)
  153.  
  154. @client.command(pass_context=True)
  155. async def e(ctx, coded):
  156. channel = ctx.message.channel
  157. encryptmessage = (encrypt(coded))
  158. embed = discord.Embed(title="", description="", color = 0xA52A2A)
  159. embed.add_field(name="Encrypt Module:", value=encryptmessage, inline=False)
  160. await client.send_message(ctx.message.channel, embed=embed)
  161.  
  162. @client.command(pass_context=True)
  163. async def d(ctx, codedd):
  164. channel = ctx.message.channel
  165. decryptmessage = (decrypt(codedd))
  166. embed = discord.Embed(title="", description="", color = 0xA52A2A)
  167. embed.add_field(name="Decrypt Module:", value=decryptmessage, inline=False)
  168. await client.send_message(ctx.message.channel, embed=embed)
  169.  
  170. @client.event
  171. async def on_message(message):
  172. await client.process_commands(message)
  173. if message.content.lower().startswith('^ping'):
  174. userID = message.author.id
  175. await client.send_message(message.channel, "pong!")
  176.  
  177. @client.command(pass_context=True)
  178. async def clear(ctx, amount=100):
  179. channel = ctx.message.channel
  180. messages = []
  181. async for message in client.logs_from(channel, limit=int(amount + 1)):
  182. messages.append(message)
  183. await client.delete_messages(messages)
  184. if amount == 1:
  185. await client.say('message has been deleted.')
  186. else:
  187. await client.say('messages have been deleted.')
  188.  
  189.  
  190.  
  191. client.run("x")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement