diff options
Diffstat (limited to 'arthur/exts/systems/system_information.py')
-rw-r--r-- | arthur/exts/systems/system_information.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arthur/exts/systems/system_information.py b/arthur/exts/systems/system_information.py index 12afc0b..51b0ed2 100644 --- a/arthur/exts/systems/system_information.py +++ b/arthur/exts/systems/system_information.py @@ -1,6 +1,7 @@ """Return system information on our production 9front infrastructure.""" import asyncio +import base64 import io import random from datetime import UTC, datetime @@ -16,6 +17,7 @@ from wand.image import Image from arthur.apis.systems import lib9front from arthur.bot import KingArthur from arthur.config import CONFIG +from arthur.exts.systems.motd import MOTD BASE_RESOURCE = "https://git.9front.org/plan9front/plan9front/HEAD/{}/raw" THRESHOLD = 0.01 @@ -195,6 +197,13 @@ I enjoy talking to you. Your mind appeals to me. It resembles my own mind except result = random.choice(contents.splitlines()) await ctx.reply(result) + @command(name="motd") + async def motd(self, ctx: Context) -> None: + """Generate an image representing the message of the day.""" + payload = MOTD.replace(b"\n", b"") + file = File(io.BytesIO(base64.b64decode(payload)), filename="motd.png") + await ctx.send(file=file) + async def setup(bot: KingArthur) -> None: """Add cog to bot.""" |