Пример #1
0
    async def vaporwave_text(self, ctx, *, msg):
        """Turns regular text into vaporwave text"""

        try:
            translated = self.lang_convert(strip_command(ctx), self.d.fun_langs.vaporwave)
            await ctx.send(translated)
        except ValueError:
            await self.bot.send_embed(ctx, ctx.l.fun.too_long)
Пример #2
0
    async def unenchant_lang(self, ctx, *, msg):
        """Turns the Minecraft enchantment table language back into regular text"""

        try:
            translated = self.lang_convert(strip_command(ctx), self.d.fun_langs.unenchant)
            await ctx.send(translated)
        except ValueError:
            await self.bot.send_embed(ctx, ctx.l.fun.too_long)
Пример #3
0
    async def villager_speak(self, ctx, *, msg):
        """Turns the given text into Minecraft villager sounds as text"""

        try:
            translated = self.lang_convert(strip_command(ctx), self.d.fun_langs.villager)
            await ctx.send(translated)
        except ValueError:
            await self.bot.send_embed(ctx, ctx.l.fun.too_long)
Пример #4
0
    async def clap_cheeks(self, ctx, *, text):
        """Puts the :clap: emoji between words"""

        clapped = ":clap: " + " :clap: ".join((strip_command(ctx)).split(" ")) + " :clap:"

        if len(clapped) > 2000:
            await self.bot.send_embed(ctx, ctx.l.fun.too_long)
            return

        await ctx.send(clapped)
Пример #5
0
    async def say_text(self, ctx, *, text):
        """Sends whatever is put into the command"""

        nice = strip_command(ctx)

        if nice.lower() in INSULTS:
            await ctx.reply("Yes.")
            return

        try:
            await ctx.message.delete()
        except Exception:
            pass

        await ctx.send(nice)
Пример #6
0
    async def sarcastic_text(self, ctx, *, msg):
        """Turns regular text into "sarcastic" text from spongebob"""

        msg = strip_command(ctx)

        caps = True
        sarcastic = ""

        for letter in msg:
            if not letter == " ":
                caps = not caps

            if caps:
                sarcastic += letter.upper()
            else:
                sarcastic += letter.lower()

        await ctx.send(sarcastic)
Пример #7
0
    async def emojify(self, ctx, *, _text=None):
        """Turns text or images into emojis"""

        text = (strip_command(ctx)).lower()

        if len(ctx.message.attachments) > 0:
            image = ctx.message.attachments[0]

            if image.filename.lower()[-4:] not in (".jpg", ".png") and not image.filename.lower()[-5:] in (".jpeg"):
                await self.bot.reply_embed(ctx, ctx.l.minecraft.mcimage.stupid_2)
                return

            try:
                image.height
            except Exception:
                await self.bot.reply_embed(ctx, ctx.l.minecraft.mcimage.stupid_3)
                return

            detailed = False

            for detailed_keyword in ("large", "high", "big", "quality", "detailed"):
                if detailed_keyword in ctx.message.content:
                    detailed = True
                    break

            async with ctx.typing():
                image_data = await self.bot.loop.run_in_executor(
                    self.bot.tp, self.tiler.generate, await image.read(use_cached=True), 1600, detailed
                )

            await ctx.reply(file=discord.File(image_data, filename=image.filename), mention_author=False)
        elif text:
            for letter in text:
                if letter in ALPHABET_LOWER:
                    text += f":regional_indicator_{letter}: "
                else:
                    text += self.d.emojified.get(letter, letter) + " "

            if len(text) > 2000:
                await self.bot.send_embed(ctx, ctx.l.fun.too_long)
            else:
                await ctx.send(text)
        else:
            await self.bot.reply_embed(ctx, "You must add text or an image to be emojified.")