Format Python code with psf/black push

github-actions 1 year ago
parent 6dc58ea025
commit 07b6882a95

@ -1084,15 +1084,12 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"):
# Check if the user is permitted to start a conversation in full channels # Check if the user is permitted to start a conversation in full channels
# check if any of the user role names match CHANNEL_CHAT_ROLES # check if any of the user role names match CHANNEL_CHAT_ROLES
if CHANNEL_CHAT_ROLES and CHANNEL_CHAT_ROLES != [None]: if CHANNEL_CHAT_ROLES and CHANNEL_CHAT_ROLES != [None]:
if not any( if not any(role.name in CHANNEL_CHAT_ROLES for role in ctx.user.roles):
role.name in CHANNEL_CHAT_ROLES for role in ctx.user.roles
):
await ctx.respond( await ctx.respond(
"You are not permitted to start a conversation in this channel." "You are not permitted to start a conversation in this channel."
) )
return return
target = ctx.channel target = ctx.channel
if private: if private:
embed_title = f"{user.name}'s private conversation with GPT" embed_title = f"{user.name}'s private conversation with GPT"

@ -883,7 +883,10 @@ class Model:
text = message.text.replace(bot_name, "") text = message.text.replace(bot_name, "")
text = text.replace("<|endofstatement|>", "") text = text.replace("<|endofstatement|>", "")
messages.append( messages.append(
{"role": "assistant", "content": text} # TODO add back the assistant's name when the API is fixed.. {
"role": "assistant",
"content": text,
} # TODO add back the assistant's name when the API is fixed..
) )
else: else:
try: try:

Loading…
Cancel
Save