From f4962cef7712ea7198fe9e030fbf252f60c92bd1 Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Fri, 4 May 2018 11:29:30 -0800 Subject: [PATCH] Paginate view_code --- exts/admin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exts/admin.py b/exts/admin.py index e9c5c46..0fda361 100644 --- a/exts/admin.py +++ b/exts/admin.py @@ -4,7 +4,7 @@ import json import logging import inspect import os -from .imports import checks +from .imports import checks, utils config_dir = 'config/' admin_id_file = 'admin_ids' @@ -188,7 +188,9 @@ class Admin: @commands.command() @commands.is_owner() async def view_code(self, ctx, code_name): - await ctx.send(f"```py\n{inspect.getsource(self.bot.get_command(code_name).callback)}\n```") + pages = utils.paginate(inspect.getsource(self.bot.get_command(code_name).callback)) + for page in pages: + await ctx.send(page) @add.command(aliases=['prefix', 'p']) @commands.cooldown(1, 5, type=commands.BucketType.guild)