Beispiel #1
0
    async def urban(self, ctx, *, search: str):
        """ Find the 'best' definition to your words """
        if not permissions.can_embed(ctx):
            return await ctx.send("I cannot send embeds here!")

        req, url = await http.get(f'http://api.urbandictionary.com/v0/define?term={search}', as_json=True)

        if url is None:
            return await ctx.send("I think the urban dictionary API broke...")

        count = len(url['list'])
        if count == 0:
            return await ctx.send("Couldn't find your search in the dictionary...")
        result = url['list'][random.randint(0, count - 1)]

        definition = result['definition']
        if len(definition) >= 1000:
                definition = definition[:1000]
                definition = definition.rsplit(' ', 1)[0]
                definition += '...'

        embed = discord.Embed(colour=0xC29FAF, description=f"**{result['word']}**\n*by: {result['author']}*")
        embed.add_field(name='Definition', value=definition, inline=False)
        embed.add_field(name='Example', value=result['example'], inline=False)
        embed.set_footer(text=f"👍 {result['thumbs_up']} | 👎 {result['thumbs_down']}")

        try:
            await ctx.send(embed=embed)
        except discord.Forbidden:
            await ctx.send("I found something, but have no access to post it... [Embed permissions]")
Beispiel #2
0
 async def slap(self, ctx, user: discord.Member = None):
     """ Slap a user! """
     rowcheck = await self.getserverstuff(ctx)
     endpoint = "url"
     if user is None:
         user = ctx.author
     try:
         await ctx.message.delete()
     except discord.Forbidden:
         pass
     try:
         r = await http.get(
             "https://nekos.life/api/v2/img/slap", res_method="json", no_cache=True
         )
     except json.JSONDecodeError:
         return await ctx.send("I couldn't contact the api ;-;")
     if rowcheck["embeds"] == 0 or not permissions.can_embed(ctx):
         return await ctx.send(
             f"😢 | **{ctx.author.name}** slaps **{user.name}**! Yowch!"
         )
     embed = discord.Embed(
         colour=249_742,
         description=f"**{ctx.author.name}** slaps **{user.name}**! Yowch!",
     )
     embed.set_image(url=r[endpoint])
     await ctx.send(embed=embed)
Beispiel #3
0
    async def colour(self, ctx, colour: str):
        """ View the colour HEX details """
        async with ctx.channel.typing():
            if not permissions.can_embed(ctx):
                return await ctx.send("I can't embed in this channel ;-;")

            if colour == "random":
                colour = "%06x" % random.randint(0, 0xFFFFFF)

            if colour[:1] == "#":
                colour = colour[1:]

            if not re.search(r'^(?:[0-9a-fA-F]{3}){1,2}$', colour):
                return await ctx.send("You're only allowed to enter HEX (0-9 & A-F)")

            try:
                r = await http.get(f"https://api.alexflipnote.dev/colour/{colour}", res_method="json", no_cache=True)
            except aiohttp.ClientConnectorError:
                return await ctx.send("The API seems to be down...")
            except aiohttp.ContentTypeError:
                return await ctx.send("The API returned an error or didn't return JSON...")

            embed = discord.Embed(colour=r["int"])
            embed.set_thumbnail(url=r["image"])
            embed.set_image(url=r["image_gradient"])

            embed.add_field(name="HEX", value=r['hex'], inline=True)
            embed.add_field(name="RGB", value=r['rgb'], inline=True)
            embed.add_field(name="Int", value=r['int'], inline=True)
            embed.add_field(name="Brightness", value=r['brightness'], inline=True)

            await ctx.send(embed=embed, content=f"{ctx.invoked_with.title()} name: **{r['name']}**")
Beispiel #4
0
    async def snipe(self, ctx, channel: discord.TextChannel = None, index: int = 0):
        """ Snipe deleted messages o3o """
        rowcheck = await self.getserverstuff(ctx)
        channel = channel or ctx.channel

        if index != 0:
            index = index - 1

        try:
            sniped = self.bot.snipes[channel.id][index]
        except KeyError:
            return await ctx.send(
                ":warning: | **No message to snipe or index must not be greater than 5 or lower than 1**",
                delete_after=10,
            )
        if rowcheck["embeds"] == 0 or not permissions.can_embed(ctx):
            return await ctx.send(
                f"```\n{sniped.author}: {sniped.clean_content}\n\nSniped by: {ctx.author}\n```"
            )

        embed = discord.Embed(
            color=randint(0x000000, 0xFFFFFF),
            timestamp=sniped.created_at,
            title=f"{sniped.author} said",
            description=sniped.clean_content,
        )
        embed.set_footer(
            text=f"Sniped by {ctx.author} | Message created",
            icon_url=ctx.author.avatar_url,
        )
        embed.set_thumbnail(url=sniped.author.avatar_url)
        await ctx.send(embed=embed)
Beispiel #5
0
 async def randomimageapi(self, ctx, url, endpoint):
     rowcheck = await self.getserverstuff(ctx)
     try:
         urltouse = url.replace("webp", "png")
         r = await http.get(urltouse, res_method="json", no_cache=True)
     except json.JSONDecodeError:
         return await ctx.send("Couldn't find anything from the API")
     if rowcheck["embeds"] == 0 or not permissions.can_embed(ctx):
         return await ctx.send(r[endpoint])
     embed = discord.Embed(colour=249_742)
     embed.set_image(url=r[endpoint])
     await ctx.send(embed=embed)
Beispiel #6
0
    async def inspireme(self, ctx):
        """ Fetch a random "inspirational message" from the bot. """
        rowcheck = await self.getserverstuff(ctx)

        page = await http.get(
            "http://inspirobot.me/api?generate=true", res_method="text", no_cache=True
        )
        if rowcheck["embeds"] == 0 or not permissions.can_embed(ctx):
            return await ctx.send(page)
        embed = discord.Embed(colour=249_742)
        embed.set_image(url=page)
        await ctx.send(embed=embed)
Beispiel #7
0
    async def avatar(self, ctx, user: discord.Member = None):
        """ Get the avatar of you or someone else """
        rowcheck = await self.getserverstuff(ctx)

        if user is None:
            user = ctx.author

        if rowcheck["embeds"] == 0 or not permissions.can_embed(ctx):
            return await ctx.send(user.avatar_url)

        embed = discord.Embed(colour=249_742)
        embed.set_image(url=user.avatar_url)
        await ctx.send(embed=embed)
Beispiel #8
0
    async def fursona(self, ctx):
        """Send AI generated image from thisfursonadoesnotexist.com"""
        rowcheck = await self.getserverstuff(ctx)

        seed = random.randint(10000, 99999)

        if rowcheck["embeds"] == 0 or not permissions.can_embed(ctx):
            return await ctx.send(f"https://thisfursonadoesnotexist.com/v2/jpgs-2x/seed{seed}.jpg")

        url = f'https://thisfursonadoesnotexist.com/v2/jpgs-2x/seed{seed}.jpg'
        await ctx.send(
            embed=discord.Embed(color=249_742).set_image(url=url).set_footer(text=f"seed: {seed}")
        )
Beispiel #9
0
    async def joinedat(self, ctx, user: discord.Member = None):
        """ Check when a user joined the current server """
        rowcheck = await self.getserverstuff(ctx)

        if user is None:
            user = ctx.author

        if rowcheck["embeds"] == 0 or not permissions.can_embed(ctx):
            return await ctx.send(
                f"**{user}** joined **{ctx.guild.name}**\n{default.date(user.joined_at)}"
            )

        embed = discord.Embed(colour=249_742)
        embed.set_thumbnail(url=user.avatar_url)
        embed.description = (
            f"**{user}** joined **{ctx.guild.name}**\n{default.date(user.joined_at)}"
        )
        await ctx.send(embed=embed)
Beispiel #10
0
    async def server(self, ctx):
        """ Check info about current server """
        if ctx.invoked_subcommand is None:

            rowcheck = await self.getserverstuff(ctx)

            findbots = sum(1 for member in ctx.guild.members if member.bot)

            emojilist = "​"
            for Emoji in ctx.guild.emojis:
                emojilist += f"{Emoji} "
            if len(emojilist) > 1024:
                emojilist = "Too long!"

            if rowcheck["embeds"] == 0 or not permissions.can_embed(ctx):
                return await ctx.send(
                    f"```\nServer Name: {ctx.guild.name}\nServer ID: {ctx.guild.id}\nMembers: {ctx.guild.member_count}\nBots: {findbots}\nOwner: {ctx.guild.owner}\nRegion: {ctx.guild.region}\nCreated At: {default.date(ctx.guild.created_at)}\n```\nEmojis: {emojilist}"
                )

            embed = discord.Embed(colour=249_742)
            embed.set_thumbnail(url=ctx.guild.icon_url)
            embed.add_field(name="Server Name",
                            value=ctx.guild.name,
                            inline=True)
            embed.add_field(name="Server ID", value=ctx.guild.id, inline=True)
            embed.add_field(name="Members",
                            value=ctx.guild.member_count,
                            inline=True)
            embed.add_field(name="Bots", value=findbots, inline=True)
            embed.add_field(name="Owner", value=ctx.guild.owner, inline=True)
            embed.add_field(name="Region", value=ctx.guild.region, inline=True)
            embed.add_field(name="Emojis", value=emojilist, inline=False)
            embed.add_field(name="Created",
                            value=default.date(ctx.guild.created_at),
                            inline=False)
            await ctx.send(content=f"ℹ information about **{ctx.guild.name}**",
                           embed=embed)
Beispiel #11
0
    async def user(self, ctx, user: discord.Member = None):
        """ Get user information """
        rowcheck = await self.getserverstuff(ctx)

        if user is None:
            user = ctx.author

        embed = discord.Embed(colour=249_742)

        usrstatus = user.status

        if usrstatus == "online" or usrstatus == discord.Status.online:
            usrstatus = "<:online:514203909363859459> Online"
        elif usrstatus == "idle" or usrstatus == discord.Status.idle:
            usrstatus = "<:away:514203859057639444> Away"
        elif usrstatus == "dnd" or usrstatus == discord.Status.dnd:
            usrstatus = "<:dnd:514203823888138240> DnD"
        elif usrstatus == "offline" or usrstatus == discord.Status.offline:
            usrstatus = "<:offline:514203770452836359> Offline"
        else:
            usrstatus = "Broken"

        if user.nick:
            nick = user.nick
        else:
            nick = "No Nickname"

        if user.activity:
            usrgame = f"{user.activity.name}"
        else:
            usrgame = "No current game"

        usrroles = ""

        for Role in user.roles:
            if "@everyone" in Role.name:
                usrroles += "| @everyone | "
            else:
                usrroles += f"{Role.name} | "

        if len(usrroles) > 1024:
            usrroles = "Too many to count!"

        if rowcheck["embeds"] == 0 or not permissions.can_embed(ctx):
            return await ctx.send(
                f"Name: `{user.name}#{user.discriminator}`\nNick: `{nick}`\nUID: `{user.id}`\nStatus: {usrstatus}\nGame: `{usrgame}`\nIs a bot? `{user.bot}`\nCreated On: `{default.date(user.created_at)}`\nRoles:\n```\n{usrroles}\n```"
            )

        embed.set_thumbnail(url=user.avatar_url)
        embed.add_field(
            name="Name",
            value=f"{user.name}#{user.discriminator}\n{nick}\n({user.id})",
            inline=True,
        )
        embed.add_field(name="Status", value=usrstatus, inline=True)
        embed.add_field(name="Game", value=usrgame, inline=True)
        embed.add_field(name="Is bot?", value=user.bot, inline=True)
        embed.add_field(name="Roles", value=usrroles, inline=False)
        embed.add_field(name="Created On",
                        value=default.date(user.created_at),
                        inline=True)
        if hasattr(user, "joined_at"):
            embed.add_field(
                name="Joined this server",
                value=default.date(user.joined_at),
                inline=True,
            )
        await ctx.send(content=f"ℹ About **{user.name}**", embed=embed)
Beispiel #12
0
    async def ship(self, ctx, user: discord.User, *, user2: discord.User = None):
        """Checks the shiprate for 2 users"""
        rowcheck = await self.getserverstuff(ctx)
        author = ctx.message.author
        if not user2:
            user2 = author
        if not user:
            await ctx.send("can't ship nothing y'know..")
        elif user.id == user2.id:
            await ctx.send("i-i can't ship the same person..")
        elif user.id == author.id and user2.id == author.id:
            await ctx.send(f"wow, you're in love with yourself, huh {ctx.author.name}?")
        elif (
            user == self.bot.user
            and user2 == author
            or user2 == self.bot.user
            and user == author
        ):
            blushes = ["m-me..? 0////0", "m-me..? >////<"]
            return await ctx.send(random.choice(blushes))

        else:
            n = randint(1, 100)
            if n == 100:
                bar = "██████████"
                heart = "💞"
            elif n >= 90:
                bar = "█████████."
                heart = "💕"
            elif n >= 80:
                bar = "████████.."
                heart = "😍"
            elif n >= 70:
                bar = "███████..."
                heart = "💗"
            elif n >= 60:
                bar = "██████...."
                heart = "❤"
            elif n >= 50:
                bar = "█████....."
                heart = "❤"
            elif n >= 40:
                bar = "████......"
                heart = "💔"
            elif n >= 30:
                bar = "███......."
                heart = "💔"
            elif n >= 20:
                bar = "██........"
                heart = "💔"
            elif n >= 10:
                bar = "█........."
                heart = "💔"
            elif n < 10:
                bar = ".........."
                heart = "🖤"
            else:
                bar = ".........."
                heart = "🖤"
            name1 = user.name.replace(" ", "")
            name1 = name1[: int(len(name1) / 2) :]
            name2 = user2.name.replace(" ", "")
            name2 = name2[int(len(name2) / 2) : :]
            if rowcheck["embeds"] == 0 or not permissions.can_embed(ctx):
                return await ctx.send(
                    f"```\n{user.name} x {user2.name}\n\n{n}% {bar} {heart}\n\nShipname: {str(name1 + name2).lower()}\n```"
                )
            ship = discord.Embed(
                description=f"**{n}%** **`{bar}`** {heart}", color=ctx.me.colour
            )
            ship.title = f"{user.name} x {user2.name}"
            ship.set_footer(text=f"Shipname: {str(name1 + name2).lower()}")
            await ctx.send(embed=ship)
Beispiel #13
0
    async def on_command_error(self, ctx, error):
        # source: https://gist.github.com/EvieePy/7822af90858ef65012ea500bcecf1612

        if hasattr(ctx.command, 'on_error'):
            return

        cog = ctx.cog
        if cog:
            if cog._get_overridden_method(cog.cog_command_error) is not None:
                return

        ignored = ()

        error = getattr(error, 'original', error)
        if isinstance(error, ignored):
            return
        elif isinstance(error, errors.NotOwner):
            return await ctx.send(
                f'{ctx.author.mention} você não é meu criador {self.bot.emoji("no_no")}'
            )
        elif isinstance(error, errors.MissingRequiredArgument):
            return await self.bot.send_help(ctx)
        elif isinstance(error, MultipleResults):
            embed = discord.Embed(title='Encontrei mais de um resultado!',
                                  colour=discord.Colour.random(),
                                  timestamp=datetime.utcnow())
            results = error.results
            if len(results) >= 5:
                msg = '\n'.join(f'{u} (ID: {u.id})' for u in results[:5])
                msg += f'\nE outro(s) {len(results) - 5} resultado(s)...'
            else:
                msg = '\n'.join(f'{u} (ID: {u.id})' for u in results)
            embed.add_field(name=msg, value='** **')
            return await ctx.send(embed=embed)
        elif isinstance(error, errors.MaxConcurrencyReached):
            try:
                # vai ver se é o dono
                permissions.is_owner(ctx)
                # se for, usa o comando
                await ctx.command.reinvoke(ctx)
            except errors.NotOwner:  # se não for, dispara o erro
                return await ctx.send(
                    f'Calma lá {ctx.author.mention}! Você só pode usar 1 comando por vez! Se o '
                    'comando possuir páginas, pare o sistema de paginação, antes de usar o '
                    'comando de novo!')
        elif isinstance(error, errors.NoPrivateMessage):
            return await ctx.send(
                f'{ctx.author.mention} Este comando só pode ser usado num servidor! {self.bot.emoji("atencao")}'
            )
        elif isinstance(error, errors.BotMissingPermissions):
            if len(error.missing_perms) == 1:
                permissoes = error.missing_perms[0]
            else:
                permissoes = ', '.join(error.missing_perms)
            return await ctx.send(
                f'{ctx.author.mention} Eu não posso executar este comando, pois não tenho permissão de '
                + f'``{permissoes}`` neste servidor! {self.bot.emoji("sad")}')
        elif isinstance(error, errors.CheckFailure):
            return await ctx.send(
                f'{ctx.author.mention} Você precisa ter permissão de `{ctx.command.perm_user}`'
                ' para usar este comando! ')
        elif isinstance(error, Forbidden):
            if not permissions.can_embed(ctx):
                if ctx.author.permissions_in(
                        ctx.message.channel).administrator:
                    msg = 'Por favor, me dê permissão de "inserir links", para que eu possa mostrar minhas mensagens.'
                else:
                    msg = 'Por favor, peça para um administrador do servidor me dar permissão de "inserir links",' \
                          ' para que eu possa mostrar minhas mensagens.'
                return await ctx.send(msg)
            if not permissions.can_upload(ctx):
                if ctx.author.permissions_in(
                        ctx.message.channel).administrator:
                    msg = 'Por favor, me dê permissão de "anexar arquivos", para que eu possa funcionar corretamente.'
                else:
                    msg = 'Por favor, peça para um administrador do servidor me dar permissão de "anexar arquivos",' \
                          ' para que eu possa funcionar corretamente.'
                return await ctx.send(msg)
            if not permissions.can_react(ctx):
                if ctx.author.permissions_in(
                        ctx.message.channel).administrator:
                    msg = 'Por favor, me dê permissão de "adicionar reações", para que eu possa funcionar corretamente.'
                else:
                    msg = 'Por favor, peça para um administrador do servidor me dar permissão de "adicionar reações",' \
                          ' para que eu possa funcionar corretamente.'
                return await ctx.send(msg)
            await ctx.send(
                f'{ctx.author.mention} eu não tenho permissão para executar esse comando, acho que algum'
                +
                ' administrador deve ter tirado minhas permissões! Com o comando ``invite``você consegue '
                + 'ter o link para me adicionar com todas as permissões.')
        elif isinstance(error, errors.BadArgument):
            if str(error).startswith('Member') and str(error).endswith(
                    'not found'):
                return await ctx.send(
                    f'{ctx.author.mention} não consegui encontrar esse membro.'
                )
            elif str(error) == 'Esse id não está banido!':
                return await ctx.send(
                    f'{ctx.author.mention} não consegui encontrar um membro banido, com este id: `{error.id}`.'
                )
            elif str(error) == 'Esse membro não está banido!':
                return await ctx.send(
                    f'{ctx.author.mention} não consegui encontrar o usuário `{error.member}` na lista'
                    f' de banidos. Teste usar o comando com aspas entre o nome do usuário caso ele'
                    f' tenha um nome com espaços, assim:\n'
                    f'`unban "{error.member} nome legal que o cara tem"`')
            elif str(error) == 'Membro mencionado não está banido!':
                return await ctx.send(
                    f'{ctx.author.mention} não consegui encontrar o membro {error.user.mention} na lista de bans.'
                )
        elif isinstance(error, errors.CommandOnCooldown):
            try:
                # vai ver se é o dono
                permissions.is_owner(ctx)
                # se for, usa o comando
                await ctx.command.reinvoke(ctx)
            except errors.NotOwner:  # se não for, dispara o erro
                await ctx.send(
                    f'Calma lá {ctx.author.mention}, você está usando meus comandos muito rápido!\n'
                    + f'Tente novamente em {error.retry_after:.2f} segundos.')
        elif isinstance(error, DuplicateBlacklist):
            await ctx.send(
                f'{self.bot.emoji("atencao")} {ctx.author.mention} Essa pessoa já está na blacklist!'
            )
        elif isinstance(error, DuplicateComandoDesativado):
            await ctx.send(
                f'{self.bot.emoji("atencao")} {ctx.author.mention} Esse comando já está desativado!'
            )
        elif isinstance(error, ComandoDesativadoNotFound):
            await ctx.send(
                f'{self.bot.emoji("atencao")} {ctx.author.mention} Esse comando já está ativado!'
            )
        elif isinstance(error, DuplicateComandoPersonalizado):
            await ctx.send(
                f'{self.bot.emoji("atencao")} {ctx.author.mention} Esse comando já está cadastrado!'
            )
        elif isinstance(error, DuplicateServidor):
            pass
        else:
            try:
                return await ctx.send(
                    f'Ocorreu o erro:```py\n{error}```Na execução do comando ```{ctx.message.content}```'
                    f'{self.bot.emoji("sad")}')
            except:
                print(
                    f'Ocorreu o erro: {error}\nNa execução do comando {ctx.message.content}'
                )
Beispiel #14
0
    async def on_command_error(self, ctx, error):
        # source: https://gist.github.com/EvieePy/7822af90858ef65012ea500bcecf1612

        # This prevents any commands with local handlers being handled here in on_command_error.
        if hasattr(ctx.command, 'on_error'):
            return

        # This prevents any cogs with an overwritten cog_command_error being handled here.
        cog = ctx.cog
        if cog:
            if cog._get_overridden_method(cog.cog_command_error) is not None:
                return

        ignored = ()

        # Allows us to check for original exceptions raised and sent to CommandInvokeError.
        # If nothing is found. We keep the exception passed to on_command_error.
        error = getattr(error, 'original', error)
        if isinstance(error, ignored):
            # Anything in ignored will return and prevent anything happening.
            return
        elif isinstance(error, errors.CommandNotFound):
            # vai pegar toda a mensagem, depois do prefixo
            comando = ctx.message.content.lower()[len(ctx.prefix):]
            # se o primeiro caracter da mensagem, não for uma letra
            if comando[0] not in ascii_letters:
                # não vai fazer nada
                return
            comando = comando.split(' ')[0]
            mostrar_erro = False
            if ctx.guild:
                conexao = Conexao()
                servidor = ServidorRepository().get_servidor(
                    conexao, ctx.guild.id)
                conexao.fechar()
                if servidor.sugestao_de_comando:
                    mostrar_erro = True
                else:
                    mostrar_erro = False
            commands = []
            for command in self.bot.get_all_commands():
                if comando.lower() == command.category:
                    e = embedHelpCategory(self.bot, ctx, comando)
                    return await ctx.send(embed=e)
                commands.append(command.name)
                commands.append(command.category)
                for alias in command.aliases:
                    commands.append(alias)
            if mostrar_erro:
                msg = f'{ctx.author.mention} <:sad:763839041095204895> eu não achei consegui ' \
                      f'achar o comando "{comando}".'
                sugestao = get_most_similar_item(comando, commands)
                if sugestao:
                    # se a sugestão for pelo menos 50% semelhante ao comando
                    if string_similarity(comando, sugestao) >= 0.6:
                        msg += f'\nVocê quis dizer ``{sugestao}``?'
                msg += f'\nPara desativar esta mensagem, use o comando ``desativar_sugestão``'
                return await ctx.send(msg, delete_after=10)
        elif isinstance(error, errors.NotOwner):
            return await ctx.send(
                f'{ctx.author.mention} você não é meu criador <a:no_no:755774680325029889>'
            )
        elif isinstance(error, errors.MissingRequiredArgument):
            return await self.bot.send_help(ctx)
        elif isinstance(error, errors.MaxConcurrencyReached):
            return await ctx.send(
                f'Calma lá {ctx.author.mention}! Você só pode usar 1 comando por vez!'
            )
        elif isinstance(error, errors.NoPrivateMessage):
            return await ctx.send(
                f'{ctx.author.mention} Este comando só pode ser usado num servidor! <a:atencao:755844029333110815>'
            )
        elif isinstance(error, errors.MissingPermissions):
            if len(error.missing_perms) == 1:
                permissoes = error.missing_perms[0]
            else:
                permissoes = ', '.join(error.missing_perms)
            return await ctx.send(
                f'{ctx.author.mention} Você precisa ter permissão de ``{permissoes}`` para usar este comando!'
            )
        elif isinstance(error, errors.BotMissingPermissions):
            if len(error.missing_perms) == 1:
                permissoes = error.missing_perms[0]
            else:
                permissoes = ', '.join(error.missing_perms)
            return await ctx.send(
                f'{ctx.author.mention} Eu não posso executar este comando, pois não tenho permissão de '
                +
                f'``{permissoes}`` neste servidor! <a:sad:755774681008832623>')
        elif isinstance(error, errors.CheckFailure):
            return await ctx.send(
                f'{ctx.author.mention} você não tem permissão para usar este comando!\nDigite '
                +
                f'`{ctx.prefix}help {ctx.command}` para ver quais permissões você precisa ter!'
            )
        elif isinstance(error, Forbidden):
            if not permissions.can_embed(ctx):
                if ctx.author.permissions_in(
                        ctx.message.channel).administrator:
                    msg = 'Por favor, me dê permissão de "inserir links", para que eu possa mostrar minhas mensagens ;-;'
                else:
                    msg = 'Por favor, peça para um administrador do servidor me dar permissão de "inserir links",' \
                          ' para que eu possa mostrar minhas mensagens ;-;'
                return await ctx.send(msg)
            if not permissions.can_upload(ctx):
                if ctx.author.permissions_in(
                        ctx.message.channel).administrator:
                    msg = 'Por favor, me dê permissão de "anexar arquivos", para que eu possa funcionar corretamente ;-;'
                else:
                    msg = 'Por favor, peça para um administrador do servidor me dar permissão de "anexar arquivos",' \
                          ' para que eu possa funcionar corretamente ;-;'
                return await ctx.send(msg)
            if not permissions.can_react(ctx):
                if ctx.author.permissions_in(
                        ctx.message.channel).administrator:
                    msg = 'Por favor, me dê permissão de "adicionar reações", para que eu possa funcionar corretamente ;-;'
                else:
                    msg = 'Por favor, peça para um administrador do servidor me dar permissão de "adicionar reações",' \
                          ' para que eu possa funcionar corretamente ;-;'
                return await ctx.send(msg)
            await ctx.send(
                f'{ctx.author.mention} eu não tenho permissão para executar esse comando, acho que algum'
                +
                ' administrador deve ter tirado minhas permissões! Com o comando ``invite``você consegue '
                + 'ter o link para me adicionar')
        elif isinstance(error, errors.BadArgument):
            if str(error).startswith('Member') and str(error).endswith(
                    'not found'):
                return await ctx.send(
                    f'{ctx.author.mention} não consegui encontrar esse membro.'
                )
            elif str(error) == 'Esse id não está banido!':
                return await ctx.send(
                    f'{ctx.author.mention} não consegui encontrar um membro banido, com este id: `{error.id}`.'
                )
            elif str(error) == 'Esse membro não está banido!':
                return await ctx.send(
                    f'{ctx.author.mention} não consegui encontrar o membro banido `{error.member}`.'
                )
            elif str(error) == 'Membro mencionado não está banido!':
                return await ctx.send(
                    f'{ctx.author.mention} não consegui encontrar o membro {error.user.mention} na lista de bans.'
                )
        elif isinstance(error, errors.CommandOnCooldown):
            await ctx.send(
                f'Calma lá {ctx.author.mention}, você está usando meus comandos muito rápido!\n'
                + f'Tente novamente em {error.retry_after:.2f} segundos.')
        else:
            if str(error).startswith('duplicate servidor'):
                pass
            elif str(error).startswith('duplicate comando desativado'):
                return await ctx.send(
                    f'<a:atencao:755844029333110815> {ctx.author.mention} Esse comando já está desativado!'
                )
            elif str(error).startswith('Este comando já está ativo!'):
                return await ctx.send(
                    f'<a:atencao:755844029333110815> {ctx.author.mention} Esse comando já está ativado!'
                )
            elif str(error).startswith('blacklisted'):
                return await ctx.send(
                    f'<a:atencao:755844029333110815> {ctx.author.mention} Essa pessoa já está na blacklist!'
                )
            elif str(error).startswith('comando personalizado duplicado'):
                return await ctx.send(
                    f'<a:atencao:755844029333110815> {ctx.author.mention} Esse comando já está cadastrado!'
                )
            else:
                try:
                    return await ctx.send(
                        f'Ocorreu o erro:```py\n{error}```Na execução do comando ```{ctx.message.content}```<a:sad'
                        ':755774681008832623>')
                except:
                    print(
                        f'Ocorreu o erro: {error}\nNa execução do comando {ctx.message.content}'
                    )