from discord.ext import commands, menus
import discord


class Confirm(menus.Menu):
    def __init__(self, msg):
        super().__init__(timeout=30.0, delete_message_after=True)
        self.msg = msg
        self.result = None

    async def send_initial_message(self, ctx, channel):
        return await channel.send(self.msg)

    @menus.button("\N{WHITE HEAVY CHECK MARK}")
    async def do_confirm(self, payload):
        self.result = True
        self.stop()

    @menus.button("\N{CROSS MARK}")
    async def do_deny(self, payload):
        self.result = False
        self.stop()

    async def prompt(self, ctx):
        await self.start(ctx, wait=True)
        return self.result


class BasicPageSource(menus.ListPageSource):
    def __init__(self, entries, per_page, *, title=None, description=None, footer=None):
        super().__init__(self, entries, per_page=per_page)
        self.title = title
        self.description = description
        self.footer = footer

    def format_page(self, menu, entries):
        offset = menu.current_page * self.per_page

        message = []
        if self.title:
            message.append(f"**{self.title}**")

        if self.description:
            message.append(self.description)

        message.append(f"Page {menu.current_page + 1}/{self.get_max_pages()}")
        message.append(
            "\n".join(f"{i+1}. {v}" for i, v in enumerate(entries, start=offset))
        )

        if self.footer:
            message.append(self.footer)

        return "\n".join(message)


class EmbedPageSource(menus.ListPageSource):
    def __init__(self, entries, per_page, embed):
        super().__init__(entries, per_page=per_page)
        self.embed = embed

    def format_page(self, menu, entries):
        offset = menu.current_page * self.per_page

        formatted = "\n".join(
            f"{i+1}. {v}" for i, v in enumerate(entries, start=offset)
        )
        self.embed.description = self.embed.description or ""
        self.embed.description += "\n\n" + formatted

        return self.embed


class BasicPages(menus.MenuPages):
    def __init__(self, entries, per_page, embed=None, **paginator_kwargs):
        if embed:
            super().__init__(
                EmbedPageSource(entries, per_page, embed), clear_reactions_after=True,
            )

        else:
            super().__init__(
                BasicPageSource(entries, per_page=per_page, **paginator_kwargs),
                clear_reactions_after=True,
            )


class Context(commands.Context):
    @property
    def console(self):
        return self.bot.console

    @property
    def db(self):
        return self.bot.pool

    async def safe_send(self, *args, **kwargs):
        if "delete_after" not in kwargs:
            kwargs["delete_after"] = 5.0

        await self.send(*args, **kwargs)

    def tick(self, tick):
        tick = bool(tick)
        ticks = {True: "\N{WHITE HEAVY CHECK MARK}", False: "\N{CROSS MARK}"}
        return ticks[tick]

    async def confirm(self, message):
        return await Confirm(message).prompt(self)

    def pages(self, entries, per_page=10, **paginator_kwargs):
        return BasicPages(entries, per_page, embed=False, **paginator_kwargs)

    def embed_pages(
        self, entries, embed, per_page=10,
    ):
        if embed is None:
            raise ValueError("Embed argument must not be None.")

        return BasicPages(entries, per_page, embed)

c7a4507c5ec647717eb021f8fe3509ccea38567e
<mask token>


class BasicPages(menus.MenuPages):
    <mask token>


class Context(commands.Context):

    @property
    def console(self):
        return self.bot.console

    @property
    def db(self):
        return self.bot.pool

    async def safe_send(self, *args, **kwargs):
        if 'delete_after' not in kwargs:
            kwargs['delete_after'] = 5.0
        await self.send(*args, **kwargs)

    def tick(self, tick):
        tick = bool(tick)
        ticks = {(True): '✅', (False): '❌'}
        return ticks[tick]

    async def confirm(self, message):
        return await Confirm(message).prompt(self)

    def pages(self, entries, per_page=10, **paginator_kwargs):
        return BasicPages(entries, per_page, embed=False, **paginator_kwargs)

    def embed_pages(self, entries, embed, per_page=10):
        if embed is None:
            raise ValueError('Embed argument must not be None.')
        return BasicPages(entries, per_page, embed)

<mask token>


class EmbedPageSource(menus.ListPageSource):

    def __init__(self, entries, per_page, embed):
        super().__init__(entries, per_page=per_page)
        self.embed = embed
    <mask token>


class BasicPages(menus.MenuPages):

    def __init__(self, entries, per_page, embed=None, **paginator_kwargs):
        if embed:
            super().__init__(EmbedPageSource(entries, per_page, embed),
                clear_reactions_after=True)
        else:
            super().__init__(BasicPageSource(entries, per_page=per_page, **
                paginator_kwargs), clear_reactions_after=True)


class Context(commands.Context):

    @property
    def console(self):
        return self.bot.console

    @property
    def db(self):
        return self.bot.pool

    async def safe_send(self, *args, **kwargs):
        if 'delete_after' not in kwargs:
            kwargs['delete_after'] = 5.0
        await self.send(*args, **kwargs)

    def tick(self, tick):
        tick = bool(tick)
        ticks = {(True): '✅', (False): '❌'}
        return ticks[tick]

    async def confirm(self, message):
        return await Confirm(message).prompt(self)

    def pages(self, entries, per_page=10, **paginator_kwargs):
        return BasicPages(entries, per_page, embed=False, **paginator_kwargs)

    def embed_pages(self, entries, embed, per_page=10):
        if embed is None:
            raise ValueError('Embed argument must not be None.')
        return BasicPages(entries, per_page, embed)

<mask token>


class BasicPageSource(menus.ListPageSource):

    def __init__(self, entries, per_page, *, title=None, description=None,
        footer=None):
        super().__init__(self, entries, per_page=per_page)
        self.title = title
        self.description = description
        self.footer = footer

    def format_page(self, menu, entries):
        offset = menu.current_page * self.per_page
        message = []
        if self.title:
            message.append(f'**{self.title}**')
        if self.description:
            message.append(self.description)
        message.append(f'Page {menu.current_page + 1}/{self.get_max_pages()}')
        message.append('\n'.join(f'{i + 1}. {v}' for i, v in enumerate(
            entries, start=offset)))
        if self.footer:
            message.append(self.footer)
        return '\n'.join(message)


class EmbedPageSource(menus.ListPageSource):

    def __init__(self, entries, per_page, embed):
        super().__init__(entries, per_page=per_page)
        self.embed = embed

    def format_page(self, menu, entries):
        offset = menu.current_page * self.per_page
        formatted = '\n'.join(f'{i + 1}. {v}' for i, v in enumerate(entries,
            start=offset))
        self.embed.description = self.embed.description or ''
        self.embed.description += '\n\n' + formatted
        return self.embed


class BasicPages(menus.MenuPages):

    def __init__(self, entries, per_page, embed=None, **paginator_kwargs):
        if embed:
            super().__init__(EmbedPageSource(entries, per_page, embed),
                clear_reactions_after=True)
        else:
            super().__init__(BasicPageSource(entries, per_page=per_page, **
                paginator_kwargs), clear_reactions_after=True)


class Context(commands.Context):

    @property
    def console(self):
        return self.bot.console

    @property
    def db(self):
        return self.bot.pool

    async def safe_send(self, *args, **kwargs):
        if 'delete_after' not in kwargs:
            kwargs['delete_after'] = 5.0
        await self.send(*args, **kwargs)

    def tick(self, tick):
        tick = bool(tick)
        ticks = {(True): '✅', (False): '❌'}
        return ticks[tick]

    async def confirm(self, message):
        return await Confirm(message).prompt(self)

    def pages(self, entries, per_page=10, **paginator_kwargs):
        return BasicPages(entries, per_page, embed=False, **paginator_kwargs)

    def embed_pages(self, entries, embed, per_page=10):
        if embed is None:
            raise ValueError('Embed argument must not be None.')
        return BasicPages(entries, per_page, embed)

<mask token>


class Confirm(menus.Menu):
    <mask token>

    async def send_initial_message(self, ctx, channel):
        return await channel.send(self.msg)

    @menus.button('✅')
    async def do_confirm(self, payload):
        self.result = True
        self.stop()

    @menus.button('❌')
    async def do_deny(self, payload):
        self.result = False
        self.stop()

    async def prompt(self, ctx):
        await self.start(ctx, wait=True)
        return self.result


class BasicPageSource(menus.ListPageSource):

    def __init__(self, entries, per_page, *, title=None, description=None,
        footer=None):
        super().__init__(self, entries, per_page=per_page)
        self.title = title
        self.description = description
        self.footer = footer

    def format_page(self, menu, entries):
        offset = menu.current_page * self.per_page
        message = []
        if self.title:
            message.append(f'**{self.title}**')
        if self.description:
            message.append(self.description)
        message.append(f'Page {menu.current_page + 1}/{self.get_max_pages()}')
        message.append('\n'.join(f'{i + 1}. {v}' for i, v in enumerate(
            entries, start=offset)))
        if self.footer:
            message.append(self.footer)
        return '\n'.join(message)


class EmbedPageSource(menus.ListPageSource):

    def __init__(self, entries, per_page, embed):
        super().__init__(entries, per_page=per_page)
        self.embed = embed

    def format_page(self, menu, entries):
        offset = menu.current_page * self.per_page
        formatted = '\n'.join(f'{i + 1}. {v}' for i, v in enumerate(entries,
            start=offset))
        self.embed.description = self.embed.description or ''
        self.embed.description += '\n\n' + formatted
        return self.embed


class BasicPages(menus.MenuPages):

    def __init__(self, entries, per_page, embed=None, **paginator_kwargs):
        if embed:
            super().__init__(EmbedPageSource(entries, per_page, embed),
                clear_reactions_after=True)
        else:
            super().__init__(BasicPageSource(entries, per_page=per_page, **
                paginator_kwargs), clear_reactions_after=True)


class Context(commands.Context):

    @property
    def console(self):
        return self.bot.console

    @property
    def db(self):
        return self.bot.pool

    async def safe_send(self, *args, **kwargs):
        if 'delete_after' not in kwargs:
            kwargs['delete_after'] = 5.0
        await self.send(*args, **kwargs)

    def tick(self, tick):
        tick = bool(tick)
        ticks = {(True): '✅', (False): '❌'}
        return ticks[tick]

    async def confirm(self, message):
        return await Confirm(message).prompt(self)

    def pages(self, entries, per_page=10, **paginator_kwargs):
        return BasicPages(entries, per_page, embed=False, **paginator_kwargs)

    def embed_pages(self, entries, embed, per_page=10):
        if embed is None:
            raise ValueError('Embed argument must not be None.')
        return BasicPages(entries, per_page, embed)

from discord.ext import commands, menus
import discord


class Confirm(menus.Menu):
    def __init__(self, msg):
        super().__init__(timeout=30.0, delete_message_after=True)
        self.msg = msg
        self.result = None

    async def send_initial_message(self, ctx, channel):
        return await channel.send(self.msg)

    @menus.button("\N{WHITE HEAVY CHECK MARK}")
    async def do_confirm(self, payload):
        self.result = True
        self.stop()

    @menus.button("\N{CROSS MARK}")
    async def do_deny(self, payload):
        self.result = False
        self.stop()

    async def prompt(self, ctx):
        await self.start(ctx, wait=True)
        return self.result


class BasicPageSource(menus.ListPageSource):
    def __init__(self, entries, per_page, *, title=None, description=None, footer=None):
        super().__init__(self, entries, per_page=per_page)
        self.title = title
        self.description = description
        self.footer = footer

    def format_page(self, menu, entries):
        offset = menu.current_page * self.per_page

        message = []
        if self.title:
            message.append(f"**{self.title}**")

        if self.description:
            message.append(self.description)

        message.append(f"Page {menu.current_page + 1}/{self.get_max_pages()}")
        message.append(
            "\n".join(f"{i+1}. {v}" for i, v in enumerate(entries, start=offset))
        )

        if self.footer:
            message.append(self.footer)

        return "\n".join(message)


class EmbedPageSource(menus.ListPageSource):
    def __init__(self, entries, per_page, embed):
        super().__init__(entries, per_page=per_page)
        self.embed = embed

    def format_page(self, menu, entries):
        offset = menu.current_page * self.per_page

        formatted = "\n".join(
            f"{i+1}. {v}" for i, v in enumerate(entries, start=offset)
        )
        self.embed.description = self.embed.description or ""
        self.embed.description += "\n\n" + formatted

        return self.embed


class BasicPages(menus.MenuPages):
    def __init__(self, entries, per_page, embed=None, **paginator_kwargs):
        if embed:
            super().__init__(
                EmbedPageSource(entries, per_page, embed), clear_reactions_after=True,
            )

        else:
            super().__init__(
                BasicPageSource(entries, per_page=per_page, **paginator_kwargs),
                clear_reactions_after=True,
            )


class Context(commands.Context):
    @property
    def console(self):
        return self.bot.console

    @property
    def db(self):
        return self.bot.pool

    async def safe_send(self, *args, **kwargs):
        if "delete_after" not in kwargs:
            kwargs["delete_after"] = 5.0

        await self.send(*args, **kwargs)

    def tick(self, tick):
        tick = bool(tick)
        ticks = {True: "\N{WHITE HEAVY CHECK MARK}", False: "\N{CROSS MARK}"}
        return ticks[tick]

    async def confirm(self, message):
        return await Confirm(message).prompt(self)

    def pages(self, entries, per_page=10, **paginator_kwargs):
        return BasicPages(entries, per_page, embed=False, **paginator_kwargs)

    def embed_pages(
        self, entries, embed, per_page=10,
    ):
        if embed is None:
            raise ValueError("Embed argument must not be None.")

        return BasicPages(entries, per_page, embed)
