# Buggy code
async def send_interactive(
    self, messages: Iterable[str], box_lang: str = None, timeout: int = 15
) -> List[discord.Message]:
    """Send multiple messages interactively.

    The user will be prompted for whether or not they would like to view
    the next message, one at a time. They will also be notified of how
    many messages are remaining on each prompt.

    Parameters
    ----------
    messages : `iterable` of `str`
        The messages to send.
    box_lang : str
        If specified, each message will be contained within a codeblock of
        this language.
    timeout : int
        How long the user has to respond to the prompt before it times out.
        After timing out, the bot deletes its prompt message.

    """
    messages = tuple(messages)
    ret = []

    more_check = lambda m: (
        m.author == self.author
        and m.channel == self.channel
        and m.content.lower() == "more"
    )

    for idx, page in enumerate(messages, 1):
        if box_lang is None:
            msg = await self.send(page)
        else:
            msg = await self.send(box(page, lang=box_lang))
        ret.append(msg)
        n_remaining = len(messages) - idx
        if n_remaining > 0:
            if n_remaining == 1:
                plural = ""
                is_are = "is"
            else:
                plural = "s"
                is_are = "are"
            query = await self.send(
                "There {} still {} message{} remaining. "
                "Type `more` to continue."
                "".format(is_are, n_remaining, plural)
            )
            try:
                resp = await self.bot.wait_for(
                    "message", check=more_check, timeout=timeout
                )
            except asyncio.TimeoutError:
                await query.delete()
                break
            else:
                try:
                    await self.channel.delete_messages((query, resp))
                except discord.HTTPException:
                    # In case the bot can't delete other users' messages,
                    # or is not a bot account
                    await query.delete()
    return ret


# Traceback (AttributeError)
Exception in command 'debug'
Traceback (most recent call last):
File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 62, in wrapped
ret = yield from coro(*args, **kwargs)
File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/dev_commands.py", line 124, in debug
await ctx.send_interactive(self.get_pages(result), box_lang="py")
File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/context.py", line 120, in send_interactive
await self.channel.delete_messages((query, resp))
AttributeError: 'DMChannel' object has no attribute 'delete_messages'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/bot.py", line 886, in invoke
yield from ctx.command.invoke(ctx)
File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 489, in invoke
yield from injected(*ctx.args, **ctx.kwargs)
File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 71, in wrapped
raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'DMChannel' object has no attribute 'delete_messages'

# Fixed code
async def send_interactive(
    self, messages: Iterable[str], box_lang: str = None, timeout: int = 15
) -> List[discord.Message]:
    """Send multiple messages interactively.

    The user will be prompted for whether or not they would like to view
    the next message, one at a time. They will also be notified of how
    many messages are remaining on each prompt.

    Parameters
    ----------
    messages : `iterable` of `str`
        The messages to send.
    box_lang : str
        If specified, each message will be contained within a codeblock of
        this language.
    timeout : int
        How long the user has to respond to the prompt before it times out.
        After timing out, the bot deletes its prompt message.

    """
    messages = tuple(messages)
    ret = []

    more_check = lambda m: (
        m.author == self.author
        and m.channel == self.channel
        and m.content.lower() == "more"
    )

    for idx, page in enumerate(messages, 1):
        if box_lang is None:
            msg = await self.send(page)
        else:
            msg = await self.send(box(page, lang=box_lang))
        ret.append(msg)
        n_remaining = len(messages) - idx
        if n_remaining > 0:
            if n_remaining == 1:
                plural = ""
                is_are = "is"
            else:
                plural = "s"
                is_are = "are"
            query = await self.send(
                "There {} still {} message{} remaining. "
                "Type `more` to continue."
                "".format(is_are, n_remaining, plural)
            )
            try:
                resp = await self.bot.wait_for(
                    "message", check=more_check, timeout=timeout
                )
            except asyncio.TimeoutError:
                await query.delete()
                break
            else:
                try:
                    await self.channel.delete_messages((query, resp))
                except (discord.HTTPException, AttributeError):
                    # In case the bot can't delete other users' messages,
                    # or is not a bot account
                    # or chanel is a DM
                    await query.delete()
    return ret