def post(self, request, format=None):
        """
        Add a new bot
        ---
        serializer: BotSerializer
        responseMessages:
            - code: 401
              message: Not authenticated
            - code: 400
              message: Not valid request
        """
        serializer = BotSerializer(data=request.data)
        if serializer.is_valid():
            bot = Bot.objects.create(owner=request.user,
                                     name=serializer.data['name'])
            return Response(BotSerializer(bot).data, status=status.HTTP_201_CREATED)
        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
def post ( self , request , format = None ) : serializer = BotSerializer ( data = request . data ) if serializer . is_valid ( ) : bot = Bot . objects . create ( owner = request . user , name = serializer . data [ 'name' ] ) return Response ( BotSerializer ( bot ) . data , status = status . HTTP_201_CREATED ) return Response ( serializer . errors , status = status . HTTP_400_BAD_REQUEST )
Add a new bot
        ---
        serializer: BotSerializer
        responseMessages:
            - code: 401
              message: Not authenticated
            - code: 400
              message: Not valid request