@commands.command(hidden=True, aliases=['cancel_task'])
@commands.is_owner()
async def debug_task(self, ctx, memory_id: hex_value):
    'Debug a task by a memory location.'
    task = object_at(memory_id)
    if ((task is None) or (not isinstance(task, asyncio.Task))):
        return (await ctx.send(f'Could not find Task object at {hex(memory_id)}.'))
    if (ctx.invoked_with == 'cancel_task'):
        task.cancel()
        return (await ctx.send(f'Cancelled task object {task!r}.'))
    paginator = commands.Paginator(prefix='```py')
    fp = io.StringIO()
    frames = len(task.get_stack())
    paginator.add_line(f'# Total Frames: {frames}')
    task.print_stack(file=fp)
    for line in fp.getvalue().splitlines():
        paginator.add_line(line)
    for page in paginator.pages:
        (await ctx.send(page))
Debug a task by a memory location.
@commands.command(hidden=True, aliases=['cancel_task'])
@commands.is_owner()
async def debug_task(self, ctx, memory_id: hex_value):
    
    task = object_at(memory_id)
    if ((task is None) or (not isinstance(task, asyncio.Task))):
        return (await ctx.send(f'Could not find Task object at {hex(memory_id)}.'))
    if (ctx.invoked_with == 'cancel_task'):
        task.cancel()
        return (await ctx.send(f'Cancelled task object {task!r}.'))
    paginator = commands.Paginator(prefix='```py')
    fp = io.StringIO()
    frames = len(task.get_stack())
    paginator.add_line(f'# Total Frames: {frames}')
    task.print_stack(file=fp)
    for line in fp.getvalue().splitlines():
        paginator.add_line(line)
    for page in paginator.pages:
        (await ctx.send(page))