changed personality to accept no args and display current personality

This commit is contained in:
phixxy 2024-01-30 03:17:13 -08:00
parent 97eabfcc60
commit 0898aaf4de

View file

@ -109,11 +109,16 @@ class ChatGPT(commands.Cog):
description="Personality",
help="Set the personality of the bot. Usage: !personality (personality)",
brief="Set the personality"
)
async def personality(self, ctx):
personality_type = ctx.message.content.split(" ", maxsplit=1)[1]
self.edit_channel_config(ctx.channel.id, "personality", personality_type)
await ctx.send("Personality changed to " + personality_type)
)
async def personality(self, ctx, personality_type=None):
if personality_type:
self.edit_channel_config(ctx.channel.id, "personality", personality_type)
await ctx.send("Personality changed to " + personality_type)
else:
channel_config = await self.get_channel_config(ctx.channel.id)
current_personality = channel_config["personality"]
await ctx.send(f"Current personality is {current_personality}")
@commands.command(
description="Topic",