aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2024-06-05 18:50:08 +0200
committerGravatar Johannes Christ <[email protected]>2024-06-05 18:56:16 +0200
commit2769800556fc552b855f30be3b5c6d37bfedf210 (patch)
treece19c0e96addc3ec5f22c54252c40db2073b8e14
parentSimplify fetching system resources (diff)
Add more system information commands
-rw-r--r--arthur/exts/systems/system_information.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/arthur/exts/systems/system_information.py b/arthur/exts/systems/system_information.py
index 53caac9..12afc0b 100644
--- a/arthur/exts/systems/system_information.py
+++ b/arthur/exts/systems/system_information.py
@@ -4,6 +4,7 @@ import asyncio
import io
import random
from datetime import UTC, datetime
+from typing import Literal
from urllib import parse
import aiohttp
@@ -175,6 +176,25 @@ I enjoy talking to you. Your mind appeals to me. It resembles my own mind except
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."""