APRIL FOOLS!

This commit is contained in:
phixxy 2024-03-31 22:44:52 -07:00
parent 37677acd08
commit 2b4f8f0b76

View file

@ -28,6 +28,8 @@ class ChatGPT(commands.Cog):
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Authorization': f'Bearer {os.getenv("openai.api_key")}', 'Authorization': f'Bearer {os.getenv("openai.api_key")}',
} }
self.today_date = time.strftime("%Y-%m-%d")
self.april_fools = self.today_date == "2022-04-01"
def create_aiohttp_session(self): def create_aiohttp_session(self):
return aiohttp.ClientSession() return aiohttp.ClientSession()
@ -749,7 +751,7 @@ class ChatGPT(commands.Cog):
# Emoji Reaction # Emoji Reaction
await self.react_to_msg(message, channel_vars["react_to_msgs"]) await self.react_to_msg(message, channel_vars["react_to_msgs"])
# Chat Response # Chat Response
if channel_vars["chat_enabled"] and not message.author.bot: if (channel_vars["chat_enabled"] or (self.april_fools and not random.randint(0,15))) and not message.author.bot:
if message.content and message.content[0] != "!": if message.content and message.content[0] != "!":
await self.chat_response(message, channel_vars, chat_history_string) await self.chat_response(message, channel_vars, chat_history_string)
elif not message.content: elif not message.content: