cleanup / respect allergies

This commit is contained in:
2025-02-24 06:21:56 -05:00
parent ac5da14632
commit c682421570
19 changed files with 66 additions and 67 deletions

View File

@ -1,5 +1,3 @@
#!/usr/bin/env python3.12
import os
import traceback
import urllib
@ -14,8 +12,6 @@ from sh import cowsay as cow_say, fortune # pylint: disable=no-name-in-module
from discord.ext import bridge, commands, tasks
from disc_havoc import Havoc
from constructors import MiscException
# pylint: disable=bare-except, broad-exception-caught, broad-exception-raised, global-statement
# pylint: disable=too-many-lines, invalid-name
"""
This plugin encompasses numerous tiny commands/functions that
@ -809,6 +805,8 @@ class Misc(commands.Cog):
Returns:
None
"""
recipient_allergic: bool = False
authorDisplay: str = ctx.author.display_name if not(ctx.author.display_name is None)\
else ctx.message.author.display_name
@ -831,7 +829,9 @@ class Misc(commands.Cog):
else:
recipient = discord.utils.escape_mentions(recipient.strip())
try:
chosen_coffee: Optional[str] = self.util.get_coffee()
if "pudding" in recipient or recipient_id in [898332028007751741]:
recipient_allergic = True
chosen_coffee: Optional[str] = self.util.get_coffee(recipient_allergic)
if not chosen_coffee:
return
response = await ctx.respond(f"*hands **{recipient_normal}** {chosen_coffee}*")
@ -1435,7 +1435,10 @@ class Misc(commands.Cog):
Returns:
None
"""
chosen_coffee = self.util.get_coffee()
recipient_allergic: bool = False
if member.id in [898332028007751741]:
recipient_allergic = True
chosen_coffee = self.util.get_coffee(recipient_allergic)
response = await ctx.interaction.respond(f"*hands <@{member.id}> {chosen_coffee}*")
await self.util.increment_counter("coffees")
try: