diff --git a/arthur/exts/systems/system_information.py b/arthur/exts/systems/system_information.py index 53caac9..c53237d 100644 --- a/arthur/exts/systems/system_information.py +++ b/arthur/exts/systems/system_information.py @@ -4,6 +4,7 @@ import io import random from datetime import UTC, datetime +from typing import Literal from urllib import parse import aiohttp @@ -175,6 +176,23 @@ async def face( await ctx.reply(file=File(out_bytes, filename="face.png")) + @command(name="wisdom") + async def wisdom(self, ctx: Context, by: Literal["ken", "rob", "rsc", "theo", "uriel"] | None = None) -> None: + """Retrieve some software engineering wisdom.""" + if by is None: + by = random.choice(("ken", "rob", "rsc", "theo", "uriel")) + + contents = await self.fetch_resource(f"lib/{by}") + result = random.choice(contents.splitlines()) + await ctx.reply(result) + + @command(name="troll") + async def troll(self, ctx: Context) -> None: + """Utter statements of utmost importance.""" + contents = await self.fetch_resource("lib/troll") + result = random.choice(contents.splitlines()) + await ctx.reply(result) + async def setup(bot: KingArthur) -> None: """Add cog to bot."""