Skip to content

Commit

Permalink
Add more system information commands
Browse files Browse the repository at this point in the history
  • Loading branch information
jchristgit committed Jun 5, 2024
1 parent 92e290a commit 9d25bf6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions arthur/exts/systems/system_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import io
import random
from datetime import UTC, datetime
from typing import Literal
from urllib import parse

import aiohttp
Expand Down Expand Up @@ -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."""
Expand Down

0 comments on commit 9d25bf6

Please sign in to comment.