aboutsummaryrefslogtreecommitdiff
path: root/modules/dump.py
diff options
context:
space:
mode:
authorromangraef <romangraef@loves.dicksinhisan.us>2018-10-14 09:38:05 +0200
committerromangraef <romangraef@loves.dicksinhisan.us>2018-10-14 09:38:05 +0200
commit2e09fe0b572d36367f448b008d6121e6a6436329 (patch)
tree90de2085eb9dc24d7f542c2356603cd4a13fce04 /modules/dump.py
parent8282428a268f87a0a4d68790521e57904826309e (diff)
downloadnotaselfbotv2finalforsure-2e09fe0b572d36367f448b008d6121e6a6436329.tar.gz
notaselfbotv2finalforsure-2e09fe0b572d36367f448b008d6121e6a6436329.tar.bz2
notaselfbotv2finalforsure-2e09fe0b572d36367f448b008d6121e6a6436329.zip
Diffstat (limited to 'modules/dump.py')
-rw-r--r--modules/dump.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/dump.py b/modules/dump.py
index 05d10a9..183dba3 100644
--- a/modules/dump.py
+++ b/modules/dump.py
@@ -1,3 +1,4 @@
+import inspect
import re
from asyncio import sleep
from functools import wraps
@@ -5,7 +6,8 @@ from typing import List
from discord import User, Embed, Profile, Guild, Member, Permissions, Message, Role, Emoji, TextChannel
from discord.ext.commands import Bot, command, Context as CommandContext, Context
-
+from discord.ext.commands import Paginator
+from datetime import datetime
async def _context_react(self: Context, emoji):
await self.message.add_reaction(emoji)
@@ -39,6 +41,14 @@ class DumpCog(object):
self.bot = bot
@command()
+ async def show_off(self, ctx: CommandContext, name: str):
+ paginator = Paginator(prefix="```py")
+ for line in inspect.getsource(self.bot.get_command(name).callback).split('\n'):
+ paginator.add_line(line.replace("`", "`\u200B"))
+ for page in paginator.pages:
+ await ctx.send(page)
+
+ @command()
async def raw(self, ctx: CommandContext, message: Message):
content: str = message.content
escaped = content.replace('```', '``\u200B`')
@@ -67,7 +77,7 @@ class DumpCog(object):
role: Role = roles[0] if len(roles) > 0 else None
embed = Embed(title=f"ID: {snowflake}")
- embed.add_field(name="When", value=str(when))
+ embed.add_field(name="When", value=str(when) + ' / ' + str(datetime.fromtimestamp(when)))
embed.add_field(name="Worker", value=str(worker))
embed.add_field(name="Process", value=str(process))
embed.add_field(name="Increment", value=str(increment))