Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. import discord
  2. from discord.ext import commands
  3.  
  4. client = commands.Bot(command_prefix="Seu prefixo")
  5. shared = discord.AutoShardedClient(shard_count=2, shard_ids=(1,2))
  6. client.remove_command("help")
  7.  
  8. modulos = ["cogs.pic"]
  9.  
  10. @client.event
  11. async def on_ready():
  12. print("__________________")
  13. print(f"Nome : {client.user.name}")
  14. print(f"Id : {client.user.id}")
  15. print("BOt : Online")
  16. await client.change_presence(activity=discord.Streaming(name="Sua messagem no rich presence", url="https://www.twitch.tv/client"))
  17.  
  18. if __name__ == "__main__":
  19. try:
  20. for modulo in modulos:
  21. client.load_extension(modulo)
  22. except Exception as error:
  23. print(f"[Erro] : {modulo} - {error}")
  24.  
  25. client.run("Seu token")
  26.  
  27. import discord
  28. from discord.ext import commands
  29.  
  30. class pic():
  31. def __init__(self, client):
  32. self.client = client
  33.  
  34. @commands.command()
  35. async def pic(self, ctx, *, user: discord.Member=None):
  36. if user is None:
  37. usuario = ctx.author.avatar_url
  38. texto = f"Olá {ctx.author.name}, está é sua imagem de perfil."
  39. else:
  40. usuario = user.avatar_url
  41. texto = f"Ola {ctx.author.name}, está é a imagem do usuário {user.name}"
  42. embed = discord.Embed(title=texto, colour=0xF4CBD1)
  43. embed.set_image(url=usuario)
  44. embed.set_footer(text=self.client.user.name+" direitos resevados.")
  45. await ctx.send(embed=embed)
  46.  
  47. def setup(client):
  48. print("[Comando Avatar] Carregado.")
  49. client.add_cog(pic(client))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement