original_docstring: 
          Deletes chat history for all users in a bot
  
          Archives conversations based on month to conversations_archive DB
  
          :param month: default is current month and max is last 6 months
          :param collection: collection to connect to
          :return: string message
          
docstring: Deletes chat history for all users in a bot
  Archives conversations based on month to conversations_archive DB
docstring_tokens: Deletes chat history for all users in a bot Archives conversations based on month to conversations_archive DB
code: def delete_bot_history(collection: Text, month: int = 1):
  
          """
          Deletes chat history for all users in a bot
  
          Archives conversations based on month to conversations_archive DB
  
          :param month: default is current month and max is last 6 months
          :param collection: collection to connect to
          :return: string message
          """
          timestamp_req = Utility.get_timestamp_previous_month(month)
          client, message = HistoryProcessor.get_mongo_connection()
          message = ' '.join([message, f',  collection: {collection}'])
          try:
              users = HistoryProcessor.fetch_chat_users_for_delete(collection=collection, timestamp_req=timestamp_req)
  
              for sender_id in users:
                  HistoryProcessor.archive_user_history(collection=collection, sender_id=sender_id, timestamp_req=timestamp_req)
  
                  HistoryProcessor.delete_user_conversations(collection=collection, sender_id=sender_id, timestamp_req=timestamp_req)
              return message
          except Exception as e:
              logger.error(e)
              raise AppException(e)
code_tokens: def delete_bot_history ( collection : Text , month : int = 1 ) : timestamp_req = Utility . get_timestamp_previous_month ( month ) client , message = HistoryProcessor . get_mongo_connection ( ) message = ' ' . join ( [ message , f',  collection: {collection}' ] ) try : users = HistoryProcessor . fetch_chat_users_for_delete ( collection = collection , timestamp_req = timestamp_req ) for sender_id in users : HistoryProcessor . archive_user_history ( collection = collection , sender_id = sender_id , timestamp_req = timestamp_req ) HistoryProcessor . delete_user_conversations ( collection = collection , sender_id = sender_id , timestamp_req = timestamp_req ) return message except Exception as e : logger . error ( e ) raise AppException ( e )
short_docstring: Deletes chat history for all users in a bot
  Archives conversations based on month to conversations_archive DB
short_docstring_tokens: Deletes chat history for all users in a bot Archives conversations based on month to conversations_archive DB
comment: """
          Deletes chat history for all users in a bot
  
          Archives conversations based on month to conversations_archive DB
  
          :param month: default is current month and max is last 6 months
          :param collection: collection to connect to
          :return: string message
          """