Charan5775 commited on
Commit
17f16b2
·
verified ·
1 Parent(s): 84b04da

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +12 -0
main.py CHANGED
@@ -88,9 +88,21 @@ async def help_command(client, message):
88
  Available commands:
89
  /start - Start the bot
90
  /help - Show this help message
 
 
 
91
  """
92
  await message.reply_text(help_text)
93
 
 
 
 
 
 
 
 
 
 
94
  # Message handler for regular text messages
95
  @myaibot.on_message(filters.text & filters.private & ~filters.command(["start", "help", "info"]))
96
  async def echo(client, message):
 
88
  Available commands:
89
  /start - Start the bot
90
  /help - Show this help message
91
+ /history - Show chat history
92
+ /clear - Clear chat history
93
+ /info - Show user information
94
  """
95
  await message.reply_text(help_text)
96
 
97
+ # Add clear command
98
+ @myaibot.on_message(filters.command("clear"))
99
+ async def clear_command(client, message):
100
+ try:
101
+ message_history.clear()
102
+ await message.reply_text("✨ Chat history has been cleared!")
103
+ except Exception as e:
104
+ await message.reply_text(f"Error clearing history: {str(e)}")
105
+
106
  # Message handler for regular text messages
107
  @myaibot.on_message(filters.text & filters.private & ~filters.command(["start", "help", "info"]))
108
  async def echo(client, message):