# Path: Cogs/Nullify.py
# def setup(bot):
# def clean(string, deaden_links = False, ctx = None):
# def escape_all(string, mentions = True, markdown = True):
# def resolve_mentions(string, ctx = None, escape = True, show_mentions = True, channel_mentions = False):


import discord, os, random
from discord.ext import commands
from PIL import Image, ImageDraw, ImageFont
from Cogs import Nullify

        if font.getsize(text)[0] <= max_width:
            lines.append(text)
        else:
            # split the line by spaces to get words
            words = text.split(' ')
            i = 0
            # append every word to a line while its width is shorter than image width
            while i < len(words):
                line = ''
                while i < len(words) and font.getsize(line + words[i])[0] <= max_width:
                    line = line + words[i] + " "
                    i += 1
                if not line:
                    line = words[i]
                    i += 1
                # when the line gets longer than the max width do not append the word,
                # add the line to the lines array
                lines.append(line)
        return lines

    
    @commands.command()
    async def clippy(self, ctx, *,text: str = ""):
        """I *know* you wanted some help with something - what was it?"""
        image = Image.open('images/clippy.png')
        image_size = image.size
        image_height = image.size[1]
        image_width = image.size[0]
        draw = ImageDraw.Draw(image)


# Path: Cogs/Nullify.py
# def setup(bot):
# def clean(string, deaden_links = False, ctx = None):
# def escape_all(string, mentions = True, markdown = True):
# def resolve_mentions(string, ctx = None, escape = True, show_mentions = True, channel_mentions = False):


# Path: Cogs/Clippy.py
import discord, os, random
from discord.ext import commands
from PIL import Image, ImageDraw, ImageFont
from Cogs import Nullify

        if font.getsize(text)[0] <= max_width:
            lines.append(text)
        else:
            # split the line by spaces to get words
            words = text.split(' ')
            i = 0
            # append every word to a line while its width is shorter than image width
            while i < len(words):
                line = ''
                while i < len(words) and font.getsize(line + words[i])[0] <= max_width:
                    line = line + words[i] + " "
                    i += 1
                if not line:
                    line = words[i]
                    i += 1
                # when the line gets longer than the max width do not append the word,
                # add the line to the lines array
                lines.append(line)
        return lines

    
    @commands.command()
    async def clippy(self, ctx, *,text: str = ""):
        """I *know* you wanted some help with something - what was it?"""
        image = Image.open('images/clippy.png')
        image_size = image.size
        image_height = image.size[1]
        image_width = image.size[0]
        draw = ImageDraw.Draw(image)


        text = Nullify.resolve_mentions(text,ctx=ctx,escape=False,channel_mentions=True)
