avoid rate limit issue with message processing

This commit is contained in:
William Lane
2023-03-19 19:47:39 -07:00
parent b03ad67f32
commit d8f148d3a0

View File

@@ -12,9 +12,10 @@ class MyClient(discord.Client):
async def on_message(self, message): async def on_message(self, message):
if message.author == self.user: if message.author == self.user:
return return
chat_response=chatgpt_response(message.content) message_content=message.content
if "mabel" in message.content.lower() or "Mabel" in message.content.lower(): chat_response=chatgpt_response(message_content)
print(message.content) if "mabel" in message_content.lower() or "Mabel" in message_content.lower():
print(message_content)
await message.channel.send(f"{chat_response}") await message.channel.send(f"{chat_response}")
return return
intents=discord.Intents.default() intents=discord.Intents.default()