예제 #1
0
    async def owo(self, ctx, *, text):
        """Converts given text to 'OwO' format"""

        # Delete the message sent by the user
        await ctx.message.delete()

        # Convert to "OwO" text
        uwu = OwO()
        owo = uwu.whatsthis(text)

        # Send the text back
        await ctx.message.channel.send(owo)
예제 #2
0
import wikipediaapi
import os
import keep_alive
import discord
import replit
from owotext import OwO

uwu = OwO()
from replit import db
import random

wiki = wikipediaapi.Wikipedia('en')
from discord.ext import commands


def isreferpage(page):
    summary = page.summary.split(" ")
    if not summary: return False
    del summary[0]
    summary = " ".join(summary)
    return summary.startswith("may refer to:")


prefixes = db["prefixes"]


def get_prefix(client=None, message=None):
    return prefixes.get(message.guild.id, "wp")


bot = commands.Bot(command_prefix=get_prefix)
예제 #3
0
 async def owoify(self, ctx, *, text: str):
     uwu = OwO()
     await qembed.send(ctx, uwu.whatsthis(text))
예제 #4
0
 def __init__(self, client):
     self.client = client
     self.uwu = OwO()
     self.cipher_suite = Fernet(Fernet.generate_key())
예제 #5
0
class Text(commands.Cog):
    """Fun ways to make your text more interesting"""
    def __init__(self, client):
        self.client = client
        self.uwu = OwO()
        self.cipher_suite = Fernet(Fernet.generate_key())

    async def cog_check(self, ctx):
        g_id = str(ctx.guild.id)
        for e in self.client.cogdata:
            if str(e["serverid"]) == str(g_id):
                if e["text"]:
                    return True
                else:
                    return False

    @commands.command(cooldown_after_parsing=True)
    async def reverse(self, ctx, *, text: str):
        """ !poow ,ffuts esreveR
        Everything you type after reverse will of course, be reversed
        """
        t_rev = text[::-1].replace("@", "@\u200B").replace("&", "&\u200B")
        return await ctx.send(f"{t_rev}")

    @commands.command(cooldown_after_parsing=True)
    async def clapify(self, ctx, *, text):
        if len(text) > 1000:
            return await ctx.send("TOO LONG TO PROCESS")
        else:
            y = str(text)
            clist = []
            r = 0
            maste = ""
            for i in range(0, len(y)):
                if y[i] == " ":
                    r += 1
                else:
                    clist.append(y[i])
                    clist.append("\U0001f44f")

                i += 1
            for k in range(0, len(clist)):
                maste = maste + clist[k]
                k += 1
            return await ctx.send(maste)

    @commands.command(cooldown_after_parsing=True)
    async def ascii(self, ctx, *, text: str):
        art = text2art(text)
        return await ctx.send(f"```{art}```")

    @commands.command(cooldown_after_parsing=True)
    async def randomfont(self, ctx, *, text: str):
        art = text2art(text, "random")
        return await ctx.send(f"```{art}```")

    @commands.command(cooldown_after_parsing=True)
    async def art(self, ctx, type: str = "random"):
        try:
            arto = art(type)
        except artError:
            return await ctx.send(
                "Your chosen art  does not exist/is not supported\n Please check the list of supported arts here: [link](https://pastebin.com/RfsFq1rj)\n Or just use randomart command!"
            )
        else:
            return await ctx.send(arto)

    @commands.command(cooldown_after_parsing=True)
    async def fontify(self, ctx, font: str, *, text: str):
        try:
            arto = text2art(text, font)
        except artError:
            return await ctx.send(
                "Your font does not exist/is not supported\n Please check the list of supported fonts here: [link](https://pastebin.com/P4cu2r0G) or just use the randomfont command!\n Or just use the randomfont command!"
            )
        else:
            return await ctx.send(f"```{arto}```")

    @commands.command(cooldown_after_parsing=True)
    async def randomart(self, ctx):
        y = random.randint(0, 1)
        if y == 0:
            arto = art("rnd-medium")
        else:
            arto = art("random-small")
        return await ctx.send(arto)

    @commands.command(cooldown_after_parsing=True)
    async def monospace(self, ctx, *, text):
        return await ctx.send("`{}`".format(text))

    @commands.command(cooldown_after_parsing=True)
    async def under(self, ctx, *, text):
        return await ctx.send(f"__{text}__")

    @commands.command(cooldown_after_parsing=True)
    async def blue(self, ctx, *, text):
        y = len(text) * "-"
        return await ctx.send(f"```md\n{text}\n{y}```")

    @commands.command(cooldown_after_parsing=True)
    async def orange(self, ctx, *, text):
        return await ctx.send(f"```arm\n{text}```")

    @commands.command(cooldown_after_parsing=True)
    async def yellow(self, ctx, *, text):
        return await ctx.send(f"```http\n{text}```")

    @commands.command(cooldown_after_parsing=True)
    async def green(self, ctx, *, text):
        return await ctx.send(f"```css\n{text}```")

    @commands.command(cooldown_after_parsing=True)
    async def cyan(self, ctx, *, text):
        return await ctx.send(f"```yaml\n{text}```")

    @commands.command(cooldown_after_parsing=True)
    async def red(self, ctx, *, text):
        return await ctx.send(f"```diff\n-{text}```")

    @commands.command(cooldown_after_parsing=True)
    async def spoiler(self, ctx, *, text):
        return await ctx.send("||{}||".format(text))

    @commands.command(cooldown_after_parsing=True)
    async def box(self, ctx, *, text):
        return await ctx.send("```{}```".format(text))

    @commands.command(cooldown_after_parsing=True)
    async def bold(self, ctx, *, text):
        return await ctx.send("**{}**".format(text))

    @commands.command(cooldown_after_parsing=True)
    async def italics(self, ctx, *, text):
        return await ctx.send("*{}*".format(text))

    @commands.command(cooldown_after_parsing=True)
    async def striked(self, ctx, *, text):
        return await ctx.send("~~{}~~".format(text))

    @commands.command(cooldown_after_parsing=True)
    async def emojify(self, ctx, *, text):
        invalidchar = 0
        if len(text) > 1000:
            return await ctx.send("Too long to process")
        else:
            emos = []
            y = str(text)
            capl = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
            smalll = "abcdefghijklmnopqrstuvwxyz"
            letst = "0123456789"
            for jool in range(0, len(y)):
                let = y[jool]
                print(let)
                if let == " ":
                    emos.append(2 * "\U00000020")
                elif let == "?":
                    emos.append("\U00002753")
                elif let == "!":
                    emos.append("\U00002757")
                elif let == "":
                    emos.append(2 * "\U00000020")
                elif let in letst:
                    pos = letst.find(let)
                    emos.append("{}\N{combining enclosing keycap}".format(let))
                    emos.append("\U00000020")
                else:
                    pos = capl.find(let)
                    if pos == -1:
                        pos = smalll.find(let)
                        if pos == -1:
                            pos = -1
                            if invalidchar == 0:
                                return await ctx.send(
                                    "invalid characters that are not alphabets, they will be replace by 🇥"
                                )
                                invalidchar += 1
                            else:
                                invalidchar += 1
                    beg = chr(ord("\U0001f1e5") + pos + 1)
                    emos.append(beg)
                    emos.append("\U00000020")
                    jool += 1

            mst = ""
            for i in range(0, len(emos)):
                print(emos[i])
                mst = mst + emos[i]
                i += 1
            return await ctx.send(mst)

    @commands.command(cooldown_after_parsing=True, aliases=["encode"])
    async def encrypt(self, ctx, *, text):
        text = str(text)
        strbytes = text.encode()
        encoded_text = self.cipher_suite.encrypt(strbytes)
        await ctx.author.send(f'Encrypted String\n`{encoded_text}`')

    @commands.command(cooldown_after_parsing=True, aliases=["decode"])
    async def decrypt(self, ctx, *, text):
        text = str(text)
        strbytes = text.encode()
        decoded_text = self.cipher_suite.decrypt(strbytes)
        await ctx.author.send(f"**Finished decryption**\n```{decoded_text}```")

    @commands.command(aliases=['zalgo'])
    async def glitch(self, ctx, *text):
        t = zalgoify.process(text)
        if len(t) > 2000:
            return await ctx.send('Your text is too long!')
        else:
            return await ctx.send(f'{t}')

    @commands.command()
    async def uwu(self, ctx, *, text):
        t = self.uwu.whatsthis(text)
        if len(t) > 2000:
            return await ctx.send('your text is to long')
        else:
            return await ctx.send(t)

    @commands.command()
    async def vapor(self, ctx, *, text):
        t = vaporize(text)
        if len(t) > 2000:
            return await ctx.send('your text is to long')
        else:
            return await ctx.send(t)
예제 #6
0
def owobot():
    import discord, ctypes, ctypes.util, logging, sys, os
    from owotext import OwO
    opusname = ctypes.util.find_library('opus')

    discord.opus.load_opus(opusname)
    if not discord.opus.is_loaded():
        raise RuntimeError('Opus failed to load')
        logging.warning('Opus failed to load.')

    uwu = OwO()

    global bound_user
    bound_user = ''

    global voiceChannelID

    client = discord.Client()

    def getAuth(
        wanted
    ):  # using this instead of dotenv due to the fact it was Not Having a Good Time
        file = open('eggbot/auth').readlines()
        for line in file:
            if line.startswith(wanted):
                line = str([line][0])
                line = line.replace(wanted + ' ', '')
                line = line.replace('/n', '')
                logging.debug('Token read as ' + str(line))
                print(str(line))
                return str(line)

    TOKEN = getAuth('TOKEN')

    defaultChannelID = '637690113631059979'

    defaultVoiceChannelID = ''

    voiceChannelID = ''

    def getHelp(message):
        logging.debug('Help raised.')
        if message.content == '~help':
            return (
                "This bot is still under development. Please be patient, but feel free to interact with it "
                "however you want. A full list of commands is coming soon, but here's what is implemented so"
                " far:\n `~help` responds with this message. Type `~help` followed by another command to learn more"
                " about that command.\n `~egg` responds with an egg.\n `~info` lists some"
                " information about this bot.\n `~owo` owo-ifies the text put after it.\n"
                " `~owox` does the same as the previous command, but deletes the original message.\n"
                "Really, there isn't much to this bot yet. But there is more to come!"
            )
        else:
            skinned = message.content.replace('~help ', '')
            skinned = skinned.replace('~', '')
            print(skinned)
            if skinned == 'egg':
                return 'This command simply responds with an egg emoji.'
            elif skinned == 'help':
                return (
                    'This command, with no other syntax, displays a general help message. By adding another command '
                    'after it (without the tilda), you can get more detailed information about that given command. '
                    'Like you just did!')
            elif skinned == 'owo':
                return (
                    'This command, when followed by a string of text, will respond with that text in an owo-ified '
                    'manner.'
                    'Functionality of omitting some words is coming soon. See also: `owox`.'
                )
            elif skinned == 'owox':
                return (
                    'Like `owo`, `owox` responds with an owo-ified version of the input text. However, this command '
                    'deletes the original message, making it seem as if the bot is saying the text.'
                )
            elif skinned == 'info':
                return 'This command displays some general information about the bot.'
            else:
                return 'Syntax error.'

    def owoify(message, add=' '):
        skinned = message.content.replace('~owo' + add, '')
        return uwu.whatsthis(skinned)

    async def on_ready():
        print('Bot is online.')

    # noinspection PyCompatibility
    @client.event
    async def on_message(message):
        global bound_user
        global voiceChannelID
        if message.author == client.user:
            return
        if message.content.startswith('~owo '):
            await message.channel.send(owoify(message))
        elif message.content.startswith('~owox '):
            await message.channel.send(owoify(message, 'x '))
            await message.delete()
        elif message.content.startswith('~help'):
            response = getHelp(message)
            await message.channel.send(response)
        elif message.content == '~egg':
            response = ':egg:'
            await message.channel.send(response)
        elif message.content == '~info':
            response = (
                "This is a prototype bot created by the user `Nexus#2396`. I really just mess with it from time to time, and I use it for TTS (coming soon!)"
            )
            await message.channel.send(response)
        elif message.content == '~template':
            response = "Template"
            await message.channel.send(response)
        elif message.content == '~bind':
            bound_user = str(message.author.id)
            print('Bound to ' + str(message.author))
            await message.channel.send('Bound to ' + str(message.author) +
                                       '\n' + 'You can now use TTS commands.')
        elif message.content == '~unbind':
            print('Bound user output is ' + bound_user)
            if str(message.author.id) == bound_user:
                bound_user = ''
                await message.channel.send('Unbound.')
                print('Unbound.')
            else:
                await message.channel.send("You aren't bound!")
        elif message.content == '~forceunbind' and str(
                message.author.id) == '328380599935172611':
            bound_user = ''
            await message.channel.send(
                'oopsie woopsie! looks like i did a bit of a fucky wucky and coomed on the TTS bindings! im vewwy sowwy. also blame nexus lmoa'
            )
        elif message.content.startswith('~setvc'):
            voiceChannelID = message.content.replace('~setvc ', '')
            try:
                voiceChannelID = str(int(voiceChannelID))
                print(voiceChannelID)
                await message.channel.send(voiceChannelID)
            except:
                print(voiceChannelID)
                await message.channel.send('Invalid Channel ID!')
        elif message.content == '~join':
            print('The currently seen voice channel is ' + voiceChannelID)
            await message.channel.send('Unfinished command.')
            if bound_user != '':
                print('Bound to ' + bound_user +
                      ', they can use the TTS bot until someone else binds.')
            else:
                bound_user = str(message.author.id)
            print('Current voice channel ID is ' + voiceChannelID)
            await client.join_voice_channel(voiceChannelID)
            await message.channel.send('Joined VC.')
        else:
            print(message.content)

    client.run(TOKEN)
예제 #7
0
파일: fun.py 프로젝트: FragileXD/TacoBot
 async def owo(self, ctx, *, message):
     message_author = ctx.author
     print("{} issued .owo UwU".format(message_author))
     uwu = OwO()
     a = uwu.whatsthis(message)
     await ctx.send(a)
예제 #8
0
파일: misc.py 프로젝트: paulinalee/MeltBot
 async def owo(self, ctx, *message):
     text = ' '.join(message)
     owo = OwO()
     await ctx.send(owo.whatsthis(text))
예제 #9
0
 async def owo(self, ctx, *, args):
     """OwO!"""
     uwu = OwO()
     await ctx.send(uwu.whatsthis(args))