Advertisement
Guest User

fuck

a guest
Jan 16th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. import discord
  2. import asyncio
  3. import requests
  4. import os, shutil
  5.  
  6. debug = False
  7. def debug_print(string):
  8. global debug
  9. if debug:
  10. print(string)
  11.  
  12. client = discord.Client()
  13.  
  14. my_secret_discord_password = 'leaked'
  15.  
  16. @client.event
  17. async def on_ready():
  18. print('Logged in as')
  19. print(client.user.name)
  20. print(client.user.id)
  21. print('------')
  22.  
  23. @client.event
  24. async def on_message(message):
  25. if message.content.startswith('/ditto'):
  26. args = message.content.split(" ")
  27. debug_print("Initiating ditto")
  28. mentions = message.mentions
  29. debug_print("Grabbed mentions")
  30. await client.delete_message(message) # cover ur tracks kids
  31. debug_print("Deleting message")
  32. target = mentions[0]
  33. debug_print("Grabbed target")
  34.  
  35. await client.change_nickname(message.author, target.display_name)
  36. debug_print("Changed nickname")
  37.  
  38. avatarURL = target.avatar_url
  39. if len(avatarURL) < 5:
  40. avatarURL = target.default_avatar_url
  41.  
  42. print("Grabbing avatar from", avatarURL)
  43. r = requests.get(avatarURL,
  44. stream=True, headers={'User-agent': 'Mozilla/5.0'})
  45.  
  46. with open("avatar.tmp.png", "wb") as f:
  47. r.raw.decode_content = True
  48. shutil.copyfileobj(r.raw, f)
  49.  
  50. debug_print("Retrieved avatar")
  51.  
  52. with open("avatar.tmp.png", "rb") as f:
  53. if len(args) > 2:
  54. if args[2]:
  55. await client.edit_profile(password=my_secret_discord_password, avatar=f.read(), username=target.name)
  56. return
  57.  
  58. await client.edit_profile(password=my_secret_discord_password, avatar=f.read())
  59.  
  60.  
  61. """async def info(self, ctx, member : discord.Member = None):
  62. if member == None:
  63. member = ctx.message.author
  64. await self.bot.say(
  65. "```xl\n" +
  66. "Name: {0.name}\n".format(member) +
  67. "Joined server: {0.joined_at}\n".format(member) +
  68. "ID: {0.id}\n".format(member) +
  69. "Has existed since: {0.created_at}\n".format(member) +
  70. "Bot?: {0.bot}\n".format(member) +
  71. "```" +
  72. "\n{0.avatar_url}".format(member))
  73. print("Run: info on {0.name}".format(member))"""
  74.  
  75.  
  76.  
  77.  
  78. client.run('email', my_secret_discord_password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement