This commit is contained in:
Paillat
2023-03-06 15:13:23 +01:00
parent 47259768bd
commit ed5de03f3e
2 changed files with 2 additions and 3 deletions

View File

@@ -169,7 +169,7 @@ class Settings (discord.Cog) :
if await moderate(api_key=api_key, text=pretend_to_be): if await moderate(api_key=api_key, text=pretend_to_be):
await ctx.respond("This has been flagged as inappropriate by OpenAI, please choose another name", ephemeral=True) await ctx.respond("This has been flagged as inappropriate by OpenAI, please choose another name", ephemeral=True)
return return
if pretend_to_be is None: if pretend_to_be == "":
pretend_to_be = "" pretend_to_be = ""
c.execute("UPDATE data SET pretend_enabled = 0 WHERE guild_id = ?", (ctx.guild.id,)) c.execute("UPDATE data SET pretend_enabled = 0 WHERE guild_id = ?", (ctx.guild.id,))
conn.commit() conn.commit()

View File

@@ -47,6 +47,7 @@ async def chat_process(self, message):
except: channels = [] except: channels = []
if api_key is None: if api_key is None:
return return
if not str(message.channel.id) in channels and message.content.find("<@"+str(self.bot.user.id)+">") == -1 and original_message == None and str(message.channel.id) != str(channel_id): return
if uses_count_today >= max_uses and premium == 0: return await message.channel.send(f"The bot has been used more than {str(max_uses)} times in the last 24 hours in this guild. Please try again in 24h.") if uses_count_today >= max_uses and premium == 0: return await message.channel.send(f"The bot has been used more than {str(max_uses)} times in the last 24 hours in this guild. Please try again in 24h.")
elif uses_count_today >= max_uses*5 and premium == 1: return elif uses_count_today >= max_uses*5 and premium == 1: return
if is_active == 0: return if is_active == 0: return
@@ -54,8 +55,6 @@ async def chat_process(self, message):
try : original_message = await message.channel.fetch_message(message.reference.message_id) try : original_message = await message.channel.fetch_message(message.reference.message_id)
except : original_message = None except : original_message = None
if original_message != None and original_message.author.id != self.bot.user.id: original_message = None if original_message != None and original_message.author.id != self.bot.user.id: original_message = None
if not str(message.channel.id) in channels and message.content.find("<@"+str(self.bot.user.id)+">") == -1 and original_message == None and str(message.channel.id) != str(channel_id): return
if original_message != None and message.guild.id == 1050769643180146749 and message.author.id != 707196665668436019: return
await message.channel.trigger_typing() await message.channel.trigger_typing()
if await moderate(api_key=api_key, text=message.content): if await moderate(api_key=api_key, text=message.content):
await message.channel.send(f"The message {message.content} has been flagged as inappropriate by the OpenAI API. Please contact OpenAI support if you think this is a mistake.") await message.channel.send(f"The message {message.content} has been flagged as inappropriate by the OpenAI API. Please contact OpenAI support if you think this is a mistake.")