Skip to content

Commit

Permalink
Merge pull request #200 from python-discord/system-pleasure-emitting-…
Browse files Browse the repository at this point in the history
…module

Allow King Arthur to send supportive PyDis-specific comments
  • Loading branch information
jchristgit authored Jun 2, 2024
2 parents 70365fc + b72aaf9 commit 9fa9f14
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 22 additions & 1 deletion arthur/exts/systems/system_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@
class SystemInformation(Cog):
"""Utilities for fetching system information from our 9front infrastructure."""

SUPPORTIVE_PYTHON_DISCORD_COMMENTS = """\
{Lemon|Bella|Chris} would {seriously|really|honestly} love to {have a word|discuss this topic} \
with you! There {seems to be|is|appears to be|is assumed to be} a {tiny|minor|major|large} \
{misunderstanding|miscommunication} here!|
{Python|Erlang|Chris' exhaust} is peace. \
{The DevOps team|Decentralized version control|The 2024 presidential election} is replication. \
Your {message|comment|idea|thought} is strength.|
Who controls {King Arthur|Kubernetes|Netcup|Joe's medication} controls the future. \
Who controls {Bella's rations|the dennis.services mail server|`git push -f` access|edit rights to this message} controls the past.|
The best {messages|comments|ideas|chats}... are those that tell you what you know already.|
If you want to keep {a secret|PGP private keys|Lemoncluster access|access to Joe's secret vacation photo library}, you must also hide it from {yourself|the moderators team|the ethical advisory board|Chris}.|
{:warning:|:information_source:|:no_entry_sign:} Detected a high amount of doublethink in this message. \
The {moderators have|administrators have|DevOps team has|Python Discord ethical advisory board has} been informed.|
Reading your message, I realize: Perhaps a lunatic was simply a minority of one.|
It's a beautiful thing, the destruction of words.|
I enjoy talking to you. Your mind appeals to me. It resembles my own mind except that you happen to be {clinically |absolutely |completely |}insane.
"""

def __init__(self, bot: KingArthur) -> None:
self.bot = bot
self.cached_blogcom = None
Expand Down Expand Up @@ -84,7 +102,10 @@ async def on_message(self, msg: Message) -> None:

if random.random() < msg_thresh:
logger.trace("Criteria hit, generating comment.")
blogcom = await self.fetch_blogcom()
if random.random() < 0.9:
blogcom = await self.fetch_blogcom()
else:
blogcom = self.SUPPORTIVE_PYTHON_DISCORD_COMMENTS

comment = lib9front.generate_blog_comment(blogcom).strip()

Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ ignore = [
[tool.ruff.lint.per-file-ignores]
# McCabe is not supported on Linux systems
"arthur/apis/systems/*.py" = ["C901", "PLR0912", "PERF401", "PLR2004"]
# Bug in complexity calculation, similar to the above
"arthur/exts/systems/system_information.py" = ["C901", "PLR2004"]


[tool.ruff.lint.isort]
Expand Down

0 comments on commit 9fa9f14

Please sign in to comment.