text: from discord.ext import commands, tasks, colour
  from googleapiclient.discovery import build
  import os, discord, random, json, asyncio, requests, praw, datetime,  translate, re
  from itertools import cycle
  from discord.embeds import Embed
  from asyncio import events
  from translate import Translator
  from io import BytesIO
  from discord.ext.commands import has_permissions
  
  class imagem(commands.Cog):
  	
  	def __init__(self, client):
  		self.client = client
  
  	@commands.command()
  	@commands.guild_only()
  	async def imagem(self, ctx, *, search):
  	   api_key = "AIzaSyAycbnPQB3wpOeLSVeSBvxMvYMiAMrKGd0"
  	   ran = random.randint(0, 9)
  	   resource = build("customsearch", "v1", developerKey=api_key).cse()
  	   result = resource.list(q=f"{search}", cx="2601e91526cbf388d", searchType="image").execute()
  	   url = result["items"][ran]["link"]
  	   embed = discord.Embed(title=f"Sua imagem {ctx.author} ({search.title()})")
  	   embed.set_image(url=url)
  	   
  	   await ctx.send(embed = embed, delete_after=60)
  	   await ctx.message.delete()
  	   
  		
  def setup(client):
  	client.add_cog(imagem(client))
  